original_string: public function init(
          ServicesInterface $services,
          ListenersInterface $listeners,
          EventsInterface $events,
          ConfigInterface $config
      ) {
          if ($this->initialized) {
              throw new RuntimeException(
                  'The components have already been initialized.'
              );
          }
          $this->initialized = true;
  
          foreach ($this->container as $component) {
              if (method_exists($component, 'getServicesConfig')) {
                  $services->add($component->getServicesConfig());
              }
              if (method_exists($component, 'getListenersConfig')) {
                  $listeners->add($component->getListenersConfig());
              }
              if (method_exists($component, 'getEventsConfig')) {
                  foreach ($component->getEventsConfig() as $item) {
                      call_user_func_array([$events, 'attach'], $item);
                  }
              }
              if (method_exists($component, 'getSystemConfig')) {
                  $config->merge($component->getSystemConfig());
              }
          }
      }
code: public function init(
          ServicesInterface $services,
          ListenersInterface $listeners,
          EventsInterface $events,
          ConfigInterface $config
      ) {
          if ($this->initialized) {
              throw new RuntimeException(
                  'The components have already been initialized.'
              );
          }
          $this->initialized = true;
  
          foreach ($this->container as $component) {
              if (method_exists($component, 'getServicesConfig')) {
                  $services->add($component->getServicesConfig());
              }
              if (method_exists($component, 'getListenersConfig')) {
                  $listeners->add($component->getListenersConfig());
              }
              if (method_exists($component, 'getEventsConfig')) {
                  foreach ($component->getEventsConfig() as $item) {
                      call_user_func_array([$events, 'attach'], $item);
                  }
              }
              if (method_exists($component, 'getSystemConfig')) {
                  $config->merge($component->getSystemConfig());
              }
          }
      }
code_tokens: public function init ( ServicesInterface $ services , ListenersInterface $ listeners , EventsInterface $ events , ConfigInterface $ config ) { if ( $ this -> initialized ) { throw new RuntimeException ( 'The components have already been initialized.' ) ; } $ this -> initialized = true ; foreach ( $ this -> container as $ component ) { if ( method_exists ( $ component , 'getServicesConfig' ) ) { $ services -> add ( $ component -> getServicesConfig ( ) ) ; } if ( method_exists ( $ component , 'getListenersConfig' ) ) { $ listeners -> add ( $ component -> getListenersConfig ( ) ) ; } if ( method_exists ( $ component , 'getEventsConfig' ) ) { foreach ( $ component -> getEventsConfig ( ) as $ item ) { call_user_func_array ( [ $ events , 'attach' ] , $ item ) ; } } if ( method_exists ( $ component , 'getSystemConfig' ) ) { $ config -> merge ( $ component -> getSystemConfig ( ) ) ; } } }
docstring: Initializes components.
  
  @param \Es\Services\ServicesInterface $services  The services
  @param \Es\Events\ListenersInterface  $listeners The listeners
  @param \Es\Events\EventsInterface     $events    The events
  @param \Es\System\ConfigInterface     $config    The system configuration
  
  @throws \RuntimeException If the components have already been initialized
docstring_tokens: Initializes components .