| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 10 | 1 | public static function scan(string $path): iterable |
|
| 11 | { |
||
| 12 | 1 | $fds = @\scandir($path, \SCANDIR_SORT_NONE); |
|
| 13 | |||
| 14 | 1 | if ($fds === false) { |
|
| 15 | throw new \Exception('Enable to list file descriptors: ' . \print_r(\error_get_last(), true)); |
||
| 16 | } |
||
| 17 | |||
| 18 | 1 | foreach ($fds as $id) { |
|
| 19 | 1 | if (!\in_array($id, ['.', '..'], true)) { |
|
| 20 | 1 | yield $id; |
|
| 21 | } |
||
| 22 | } |
||
| 23 | 1 | } |
|
| 24 | } |
||
| 25 |