| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | protected function executeMiddleware(array $route) |
||
| 16 | { |
||
| 17 | $this->request = new RequestHandler($route['protocol'],new Uri($this->host.$route['url'])); |
||
|
|
|||
| 18 | $this->serverRequest = (new Factory())->createServerRequest($route['protocol'],new Uri($this->host.$route['url'])); |
||
| 19 | |||
| 20 | $middlewares = (is_array($route['middlewares'])) ? $route['middlewares'] : [ $route['middlewares'] ]; |
||
| 21 | |||
| 22 | foreach($middlewares as $middleware){ |
||
| 23 | if(is_null($middleware)){ |
||
| 24 | continue; |
||
| 25 | } |
||
| 26 | |||
| 27 | $this->middlewareHandle($middleware); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $this; |
||
| 31 | } |
||
| 54 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.