Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
11 | 4 | public function getFinder(string $path, ?array $validExtensions = null): Finder |
|
12 | { |
||
13 | 4 | $finder = (new Finder())->files() |
|
14 | 4 | ->in($path) |
|
15 | 4 | ->ignoreUnreadableDirs(); |
|
16 | 4 | if ($validExtensions !== null && count($validExtensions) > 0) { |
|
17 | 4 | $finder->name(sprintf( |
|
18 | 4 | '/\.(%s)$/i', |
|
19 | 4 | implode('|', $validExtensions) |
|
20 | )); |
||
21 | } |
||
22 | |||
23 | 4 | return $finder; |
|
24 | } |
||
42 |