Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function find(): array |
||
27 | { |
||
28 | if (!file_exists($this->composerAutoloadPath)) { |
||
29 | throw new InvalidArgumentException( |
||
30 | sprintf( |
||
31 | "Cannot get Composer class map. Invalid path: %s.", |
||
32 | $this->composerAutoloadPath |
||
33 | ) |
||
34 | ); |
||
35 | } |
||
36 | |||
37 | $classLoader = require($this->composerAutoloadPath); |
||
38 | if (! $classLoader instanceof ClassLoader) { |
||
39 | throw new InvalidArgumentException( |
||
40 | sprintf( |
||
41 | "Cannot get Composer class map. Invalid composer autoload: %s.", |
||
42 | $this->composerAutoloadPath |
||
43 | ) |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | return array_keys($classLoader->getClassMap()); |
||
48 | } |
||
50 |