Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
81 | 1 | public function compile(): array |
|
82 | { |
||
83 | |||
84 | 1 | $routes = $this->routes; |
|
85 | 1 | $routesLength = count($routes); |
|
86 | 1 | for ($i = 0; $i < $routesLength; $i++) { |
|
87 | 1 | $matches = []; |
|
88 | 1 | $match = preg_match( |
|
89 | 1 | $routes[$i]->getExpr(), |
|
90 | 1 | $this->activeRoute, |
|
91 | 1 | $matches |
|
92 | ); |
||
93 | 1 | if ($match) { |
|
94 | 1 | $this->params = $matches; |
|
95 | 1 | $this->matchingRoute = $routes[$i]->getExpr(); |
|
96 | 1 | array_shift($matches); |
|
97 | 1 | return $matches; |
|
98 | } |
||
99 | } |
||
100 | 1 | return []; |
|
101 | } |
||
113 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..