public function build(array $config)
    {
        $container = new Container();
        foreach ((array) $config as $name => $component) {
            if (!is_array($component) || !array_key_exists('component', $component)) {
                $container->register($name, $component);
                continue;
            }

            $component = $this->applyDefaults($component);
            $container->register(
                $name,
                $this->buildDefinition($component['component']),
                $component['shared']
            );
        }

        return $container;
    }
public function build(array $config)
    {
        $container = new Container();
        foreach ((array) $config as $name => $component) {
            if (!is_array($component) || !array_key_exists('component', $component)) {
                $container->register($name, $component);
                continue;
            }

            $component = $this->applyDefaults($component);
            $container->register(
                $name,
                $this->buildDefinition($component['component']),
                $component['shared']
            );
        }

        return $container;
    }
public function build ( array $ config ) { $ container = new Container ( ) ; foreach ( ( array ) $ config as $ name => $ component ) { if ( ! is_array ( $ component ) || ! array_key_exists ( 'component' , $ component ) ) { $ container -> register ( $ name , $ component ) ; continue ; } $ component = $ this -> applyDefaults ( $ component ) ; $ container -> register ( $ name , $ this -> buildDefinition ( $ component [ 'component' ] ) , $ component [ 'shared' ] ) ; } return $ container ; }
Builds container and component definitions

@param array $config

@return Container
Builds container and component definitions