class ClassMapGenerator in X Autoload 7.5
Same name and namespace in other branches
- 7.4 lib/Discovery/ClassMapGenerator.php \Drupal\xautoload\Discovery\ClassMapGenerator
Hierarchy
- class \Drupal\xautoload\Discovery\ClassMapGenerator implements ClassMapGeneratorInterface
Expanded class hierarchy of ClassMapGenerator
5 files declare their use of ClassMapGenerator
- bootstrap.php in tests/
bootstrap.php - ClassFinderAdapter.php in src/
Adapter/ ClassFinderAdapter.php - ComposerJsonTest.php in tests/
src/ ComposerJsonTest.php - ServiceContainerInterface.php in src/
DIC/ ServiceContainerInterface.php - ServiceFactory.php in src/
DIC/ ServiceFactory.php
File
- src/
Discovery/ ClassMapGenerator.php, line 6
Namespace
Drupal\xautoload\DiscoveryView source
class ClassMapGenerator implements ClassMapGeneratorInterface {
/**
* @param string[] $paths
*
* @return string[]
*/
function wildcardPathsToClassmap($paths) {
$files = $this
->wildcardPathsToFiles($paths);
return $this
->filesToClassmap($files);
}
/**
* @param string[] $files
*
* @return string[]
*/
protected function filesToClassmap($files) {
$map = array();
foreach ($files as $file) {
$classes = FileInspector::inspectPhpFile($file);
foreach ($classes as $class) {
$map[$class] = $file;
}
}
return $map;
}
/**
* @param string[] $paths
*
* @return string[]
*/
protected function wildcardPathsToFiles($paths) {
$wildcardFinder = new WildcardFileFinder();
$wildcardFinder
->addPaths($paths);
return $wildcardFinder
->getFiles();
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ClassMapGenerator:: |
protected | function | ||
ClassMapGenerator:: |
function |
Overrides ClassMapGeneratorInterface:: |
||
ClassMapGenerator:: |
protected | function |