| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public static function getAutoloadedFiles($composerJsonPath): array |
||
| 10 | { |
||
| 11 | if (! file_exists($composerJsonPath)) { |
||
| 12 | return []; |
||
| 13 | } |
||
| 14 | |||
| 15 | $basePath = Str::before($composerJsonPath, 'composer.json'); |
||
| 16 | |||
| 17 | $composerContents = json_decode(file_get_contents($composerJsonPath), true); |
||
| 18 | |||
| 19 | $paths = array_merge( |
||
| 20 | $composerContents['autoload']['files'] ?? [], |
||
| 21 | $composerContents['autoload-dev']['files'] ?? [] |
||
| 22 | ); |
||
| 23 | |||
| 24 | return array_map(function (string $path) use ($basePath) { |
||
| 25 | return realpath($basePath.$path); |
||
| 26 | }, $paths); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |