src/Guzzle/Cache/CacheAdapterFactory.php
private static function createObject($className, array $args = null)
    {
        try {
            if (!$args) {
                return new $className;
            } else {
                $c = new \ReflectionClass($className);
                return $c->newInstanceArgs($args);
            }
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }
    }
private static function createObject($className, array $args = null)
    {
        try {
            if (!$args) {
                return new $className;
            } else {
                $c = new \ReflectionClass($className);
                return $c->newInstanceArgs($args);
            }
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }
    }
private static function createObject ( $ className , array $ args = null ) { try { if ( ! $ args ) { return new $ className ; } else { $ c = new \ ReflectionClass ( $ className ) ; return $ c -> newInstanceArgs ( $ args ) ; } } catch ( \ Exception $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Create a class using an array of constructor arguments

@param string $className Class name
@param array  $args      Arguments for the class constructor

@return mixed
@throws RuntimeException
@deprecated
@codeCoverageIgnore
Create a class using an array of constructor arguments