| Conditions | 4 |
| Paths | 6 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | protected array $middlewares = []; |
||
| 12 | protected RequestHandler $request; |
||
| 13 | protected ServerRequest $serverRequest; |
||
| 14 | |||
| 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; |
||
| 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.