src/Application.php
protected function doComponentPass(array $components)
    {
        foreach ($components as $component) {
            $instance = $this->container->injectConstructor($component);
            $this->components[$component] = $instance;

            if ($instance instanceof ProviderInterface) {
                $instance->provides($this);
            }
        }

        foreach ($this->components as $instance) {
            $instance->init($this->providers);

            DomainEvents::dispatch(new InitializedComponentEvent($instance));
        }
    }
protected function doComponentPass(array $components)
    {
        foreach ($components as $component) {
            $instance = $this->container->injectConstructor($component);
            $this->components[$component] = $instance;

            if ($instance instanceof ProviderInterface) {
                $instance->provides($this);
            }
        }

        foreach ($this->components as $instance) {
            $instance->init($this->providers);

            DomainEvents::dispatch(new InitializedComponentEvent($instance));
        }
    }
protected function doComponentPass ( array $ components ) { foreach ( $ components as $ component ) { $ instance = $ this -> container -> injectConstructor ( $ component ) ; $ this -> components [ $ component ] = $ instance ; if ( $ instance instanceof ProviderInterface ) { $ instance -> provides ( $ this ) ; } } foreach ( $ this -> components as $ instance ) { $ instance -> init ( $ this -> providers ) ; DomainEvents :: dispatch ( new InitializedComponentEvent ( $ instance ) ) ; } }
Initialize a group of components.

@param array $components A array of components
Initialize a group of components .