| Conditions | 6 |
| Paths | 5 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 2 | public function read(string $directory): Generator |
|
| 18 | { |
||
| 19 | 2 | $files = @scandir($directory); |
|
| 20 | |||
| 21 | 2 | if ($files !== false) { |
|
| 22 | 1 | foreach ($files as $value) { |
|
| 23 | 1 | $path = (string) realpath($directory . DIRECTORY_SEPARATOR . $value); |
|
| 24 | 1 | if (!is_dir($path)) { |
|
| 25 | 1 | yield $path; |
|
| 26 | 1 | } elseif ($value !== '.' && $value !== '..') { |
|
| 27 | 1 | yield from $this->read($path); |
|
| 28 | } |
||
| 33 |