Total Complexity | 5 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class PathFinder implements PathFinderInterface |
||
11 | { |
||
12 | /** |
||
13 | * @return string[] |
||
14 | */ |
||
15 | 37 | public function matchingPattern(string $pattern): array |
|
16 | { |
||
17 | 37 | if ($pattern === '') { |
|
18 | 32 | return []; |
|
19 | } |
||
20 | |||
21 | 37 | $this->ensureGlobBraceIsDefined(); |
|
22 | |||
23 | 37 | return glob($pattern, GLOB_BRACE) ?: []; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris or Alpine Linux. |
||
28 | * |
||
29 | * @see https://www.php.net/manual/en/function.glob.php |
||
30 | */ |
||
31 | 37 | private function ensureGlobBraceIsDefined(): void |
|
35 | } |
||
36 | } |
||
38 |