Total Complexity | 11 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class CompositeMatcher implements PathMatcherInterface |
||
11 | { |
||
12 | private bool $matchAny; |
||
13 | |||
14 | /** |
||
15 | * @var PathMatcherInterface[] |
||
16 | */ |
||
17 | private array $matchers; |
||
18 | |||
19 | 14 | private function __construct(bool $matchAny, PathMatcherInterface ...$matchers) |
|
23 | 14 | } |
|
24 | |||
25 | /** |
||
26 | * Get an instance of composite matcher that gives a match if any of sub-matchers match. |
||
27 | * |
||
28 | * @param PathMatcherInterface ...$matchers Matchers to check. |
||
29 | * |
||
30 | * @return static |
||
31 | */ |
||
32 | 7 | public static function any(PathMatcherInterface ...$matchers): self |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get an instance of composite matcher that gives a match only if all of sub-matchers match. |
||
39 | * |
||
40 | * @param PathMatcherInterface ...$matchers Matchers to check. |
||
41 | * |
||
42 | * @return static |
||
43 | */ |
||
44 | 7 | public static function all(PathMatcherInterface ...$matchers): self |
|
47 | } |
||
48 | |||
49 | 14 | public function match(string $path): ?bool |
|
74 |