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); |
||
9 | 1 | public static function list(): iterable |
|
10 | { |
||
11 | 1 | $fds = @\scandir(self::PATH, \SCANDIR_SORT_NONE); |
|
12 | |||
13 | 1 | if ($fds === false) { |
|
14 | throw new \Exception(\error_get_last()['mesage']); |
||
15 | } |
||
16 | |||
17 | 1 | foreach ($fds as $id) { |
|
18 | 1 | if (!\in_array($id, ['.', '..'], true)) { |
|
19 | 1 | yield $id; |
|
20 | } |
||
21 | } |
||
22 | 1 | } |
|
23 | } |
||
24 |