mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-08-07 07:16:13 +00:00
39191885e5
- laravel/framework ^11.45 -> ^12.0 (installed 12.63.0) - phpunit/phpunit ^10.5 -> ^11.0; migrate phpunit.xml to the 11.5 schema - graham-campbell/github ^12.5 -> ^13.0 (v12 caps illuminate/support at ^11) - Carbon 3 pulled in by L12; no application code changes required - gitignore /.phpunit.cache Full suite green: 59 tests, 128 assertions (1 skipped).
composer/class-map-generator
Utilities to generate class maps and scan PHP code.
Installation
Install the latest version with:
composer require composer/class-map-generator
Requirements
- PHP 7.2 is required.
Basic usage
If all you want is to scan a directory and extract a classmap with all classes/interfaces/traits/enums mapped to their paths, you can simply use:
use Composer\ClassMapGenerator\ClassMapGenerator;
$map = ClassMapGenerator::createMap('path/to/scan');
foreach ($map as $symbol => $path) {
// do your thing
}
For more advanced usage, you can instantiate a generator object and call scanPaths one or more time then call getClassMap to get a ClassMap object containing the resulting map + eventual warnings.
use Composer\ClassMapGenerator\ClassMapGenerator;
$generator = new ClassMapGenerator;
$generator->scanPaths('path/to/scan');
$generator->scanPaths('path/to/scan2');
$classMap = $generator->getClassMap();
$classMap->sort(); // optionally sort classes alphabetically
foreach ($classMap->getMap() as $symbol => $path) {
// do your thing
}
foreach ($classMap->getAmbiguousClasses() as $symbol => $paths) {
// warn user about ambiguous class resolution
}
License
composer/class-map-generator is licensed under the MIT License, see the LICENSE file for details.