src/Bootstrap.php
public static function collectServices(ContainerBuilder $container, \Traversable $namespaces) {
    $service_directories = [];
    foreach ($namespaces as $directory) {
      // $directory will correspond to the src dir, so up one level.
      $service_directories[] = $directory . DIRECTORY_SEPARATOR . '..';
    }
    $loader = new PhpFileLoader($container, new FileLocator($service_directories));
    $loader->load('services.php');
  }
public static function collectServices(ContainerBuilder $container, \Traversable $namespaces) {
    $service_directories = [];
    foreach ($namespaces as $directory) {
      // $directory will correspond to the src dir, so up one level.
      $service_directories[] = $directory . DIRECTORY_SEPARATOR . '..';
    }
    $loader = new PhpFileLoader($container, new FileLocator($service_directories));
    $loader->load('services.php');
  }
public static function collectServices ( ContainerBuilder $ container , \ Traversable $ namespaces ) { $ service_directories = [ ] ; foreach ( $ namespaces as $ directory ) { // $directory will correspond to the src dir, so up one level. $ service_directories [ ] = $ directory . DIRECTORY_SEPARATOR . '..' ; } $ loader = new PhpFileLoader ( $ container , new FileLocator ( $ service_directories ) ) ; $ loader -> load ( 'services.php' ) ; }
Iterate through all namespace dirs and add services to the container.

@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
The container builder.
@param \Traversable $namespaces
The namespaces.
Iterate through all namespace dirs and add services to the container .