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 | 2 | public static function scan(string $path): iterable |
|
11 | { |
||
12 | 2 | $fds = @\scandir($path, \SCANDIR_SORT_NONE); |
|
13 | |||
14 | 2 | if ($fds === false) { |
|
15 | throw new \Exception('Unable to list file descriptors: ' . \print_r(\error_get_last(), true)); |
||
16 | } |
||
17 | |||
18 | 2 | foreach ($fds as $id) { |
|
19 | 2 | if (!\in_array($id, ['.', '..'], true)) { |
|
20 | 2 | yield $id; |
|
21 | } |
||
22 | } |
||
23 | 2 | } |
|
24 | } |
||
25 |