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;
    }