public static function extractNamespaces(ClassLoader $classLoader) {
    $namespaces = [];
    foreach ($classLoader->getPrefixes() as $namespace => $directories) {
      $namespaces[$namespace] = $directories[0];
    }
    foreach ($classLoader->getPrefixesPsr4() as $namespace => $directories) {
      $namespaces[$namespace] = $directories[0];
    }
    return new \ArrayIterator($namespaces);
  }
public static function extractNamespaces(ClassLoader $classLoader) {
    $namespaces = [];
    foreach ($classLoader->getPrefixes() as $namespace => $directories) {
      $namespaces[$namespace] = $directories[0];
    }
    foreach ($classLoader->getPrefixesPsr4() as $namespace => $directories) {
      $namespaces[$namespace] = $directories[0];
    }
    return new \ArrayIterator($namespaces);
  }
public static function extractNamespaces ( ClassLoader $ classLoader ) { $ namespaces = [ ] ; foreach ( $ classLoader -> getPrefixes ( ) as $ namespace => $ directories ) { $ namespaces [ $ namespace ] = $ directories [ 0 ] ; } foreach ( $ classLoader -> getPrefixesPsr4 ( ) as $ namespace => $ directories ) { $ namespaces [ $ namespace ] = $ directories [ 0 ] ; } return new \ ArrayIterator ( $ namespaces ) ; }
Extracts a list of namespaces and directories from the class loader.

@param \Composer\Autoload\ClassLoader $classLoader
The composer classloader object.

@return \ArrayIterator
An iterate-able list of namespaces and directories.
Extracts a list of namespaces and directories from the class loader .