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