public function build($class, array $args)
    {
        // Normalize class name
        $class = $this->normalizeClassName($class);

        if (isset($this->cache[$class])) {
            return $this->cache[$class];
        } else {
            if (class_exists($class, true)) {
                $instance = $this->getInstance($class, $args);
                $this->cache[$class] = $instance;

                return $instance;
            } else {
                throw new RuntimeException(sprintf(
                    'Can not build non-existing class "%s". The class does not exist or it does not follow PSR-0', $class
                ));
            }
        }
    }
public function build($class, array $args)
    {
        // Normalize class name
        $class = $this->normalizeClassName($class);

        if (isset($this->cache[$class])) {
            return $this->cache[$class];
        } else {
            if (class_exists($class, true)) {
                $instance = $this->getInstance($class, $args);
                $this->cache[$class] = $instance;

                return $instance;
            } else {
                throw new RuntimeException(sprintf(
                    'Can not build non-existing class "%s". The class does not exist or it does not follow PSR-0', $class
                ));
            }
        }
    }
public function build ( $ class , array $ args ) { // Normalize class name $ class = $ this -> normalizeClassName ( $ class ) ; if ( isset ( $ this -> cache [ $ class ] ) ) { return $ this -> cache [ $ class ] ; } else { if ( class_exists ( $ class , true ) ) { $ instance = $ this -> getInstance ( $ class , $ args ) ; $ this -> cache [ $ class ] = $ instance ; return $ instance ; } else { throw new RuntimeException ( sprintf ( 'Can not build non-existing class "%s". The class does not exist or it does not follow PSR-0' , $ class ) ) ; } } }
Builds an instance of a class passing arguments to its constructor

@param string $class PSR-0 compliant class name
@param array $args Arguments to be passed to class's constructor
@throws \RuntimeException If attempting to build non-existing class
@return object
Builds an instance of a class passing arguments to its constructor