| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | protected function getAllFilesInDir($directory, $fileExtension) |
||
| 13 | { |
||
| 14 | $directory = realpath($directory); |
||
| 15 | $it = new RecursiveDirectoryIterator($directory); |
||
| 16 | $it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::LEAVES_ONLY); |
||
| 17 | $it = new RegexIterator($it, '(\.' . preg_quote($fileExtension) . '$)'); |
||
| 18 | |||
| 19 | foreach ($it as $file) { |
||
| 20 | /** @var \SplFileObject $file */ |
||
| 21 | $filepath = $file->getRealPath(); |
||
| 22 | yield $filepath; |
||
| 23 | } |
||
| 38 |