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