Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
20 | function listClassesInDirecories(string ...$directories): iterable |
||
21 | { |
||
22 | 1 | $sourceLocator = new AggregateSourceLocator([ |
|
23 | new DirectoriesSourceLocator( |
||
24 | $directories, |
||
25 | 1 | (new BetterReflection())->astLocator() |
|
26 | 1 | ), |
|
27 | // ↓ required to autoload parent classes/interface from another directory than /src (e.g. /vendor) |
||
28 | 1 | new AutoloadSourceLocator((new BetterReflection())->astLocator()), |
|
29 | ]); |
||
30 | |||
31 | foreach ((new ClassReflector($sourceLocator))->getAllClasses() as $class) { |
||
32 | yield $class->getName(); |
||
33 | } |
||
34 | } |
||
35 | |||
47 |