| Conditions | 4 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 2 | public function getListOfAllPHPFiles(string $dir): array |
|
| 16 | { |
||
| 17 | 2 | $result = []; |
|
| 18 | |||
| 19 | 2 | $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)); |
|
| 20 | |||
| 21 | 2 | foreach ($rii as $file) { |
|
| 22 | 2 | if ($file->isFile() && str_contains($file->getFilename(), '.php')) { |
|
| 23 | 2 | $fullpath = $file->getPath().'/'.$file->getFilename(); |
|
| 24 | |||
| 25 | // remove given dir from fullpath |
||
| 26 | 2 | $fullpath = str_replace($dir, '', $fullpath); |
|
| 27 | |||
| 28 | 2 | $result[] = $fullpath; |
|
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | 2 | return $result; |
|
| 33 | } |
||
| 35 |