Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
46 | 1 | public function compile(): array |
|
47 | { |
||
48 | 1 | $routes = $this->routes->get(); |
|
49 | 1 | $routesLength = count($routes); |
|
50 | 1 | for ($i = 0; $i < $routesLength; $i++) { |
|
51 | 1 | $matches = []; |
|
52 | 1 | $match = preg_match($routes[$i], $this->activeRoute, $matches); |
|
53 | 1 | if ($match) { |
|
54 | 1 | array_shift($matches); |
|
55 | 1 | return $matches; |
|
56 | } |
||
57 | } |
||
58 | 1 | return []; |
|
59 | } |
||
61 |