| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 1 | public function streamSafeGlob($directory, $filePattern) : array |
|
| 19 | { |
||
| 20 | 1 | $files = scandir($directory); |
|
| 21 | 1 | $found = []; |
|
| 22 | |||
| 23 | 1 | foreach ($files as $filename) { |
|
| 24 | 1 | if (in_array($filename, ['.', '..'])) { |
|
| 25 | 1 | continue; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | if (fnmatch($filePattern, $filename)) { |
|
| 29 | 1 | $found[] = "{$directory}/{$filename}"; |
|
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | 1 | return $found; |
|
| 34 | } |
||
| 35 | } |
||
| 36 |