Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
39 | 4 | protected function matchRule(Route $route, string $pathUrl): ?Route |
|
40 | { |
||
41 | 4 | $activeRoute = null; |
|
42 | |||
43 | 4 | $regexp = $this->routeService->makeRegExp($route); |
|
44 | |||
45 | 4 | if (preg_match('~^'.$regexp.'$~Uiu', $pathUrl, $values)) { |
|
46 | 3 | $filterValues = array_filter(array_keys($values), '\is_string'); |
|
47 | 3 | $matches = array_intersect_key($values, array_flip($filterValues)); |
|
48 | 3 | $activeRoute = $route->setMatches($matches); |
|
49 | } |
||
50 | |||
51 | 4 | return $activeRoute; |
|
52 | } |
||
53 | } |
||
54 |