Conditions | 6 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
56 | 3 | protected function listFiles(array $passedPath): array |
|
57 | { |
||
58 | 3 | $path = realpath(implode(DIRECTORY_SEPARATOR, $passedPath)); |
|
59 | 3 | if (!$path) { |
|
60 | 1 | return []; |
|
61 | } |
||
62 | 2 | $available = []; |
|
63 | 2 | $files = scandir($path); |
|
64 | 2 | if (false !== $files) { |
|
65 | 2 | foreach ($files as $file) { |
|
66 | if ( |
||
67 | 2 | is_file($path . DIRECTORY_SEPARATOR . $file) |
|
68 | 2 | && strpos($file, '.php') |
|
69 | ) { |
||
70 | 2 | $available[] = $path . DIRECTORY_SEPARATOR . $file; |
|
71 | } |
||
72 | } |
||
73 | } |
||
74 | 2 | return $available; |
|
75 | } |
||
77 |