Skip to content

Commit

Permalink
Add support for autoloaded arrays (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
stancl committed Nov 28, 2020
1 parent 9b8ae7a commit ed56881
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ApplicationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ private static function getProjectClasses(string $namespace, string $rootDir): a
$devClasses = [];
$autoloadDev = self::$composer['autoload-dev'] ?? [];
$autoloadDevPsr4 = $autoloadDev['psr-4'] ?? [];
foreach ($autoloadDevPsr4 as $path) {
$devClasses = array_merge($devClasses, array_keys(ClassMapGenerator::createMap($path)));
foreach ($autoloadDevPsr4 as $paths) {
$paths = is_array($paths) ? $paths : [$paths];

foreach ($paths as $path) {
$devClasses = array_merge($devClasses, array_keys(ClassMapGenerator::createMap($path)));
}
}

// now class list of maps are assembled, use class_exists calls to explicitly autoload them,
Expand Down

0 comments on commit ed56881

Please sign in to comment.