original_string: 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');
    }
code: 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');
    }
code_tokens: 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' ) ; }
docstring: 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.
docstring_tokens: Iterate through all namespace dirs and add services to the container .