| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 58 | public function __invoke(ServerRequestInterface $request) |
||
| 59 | { |
||
| 60 | |||
| 61 | 5 | $next = $this->next ?: function (ServerRequestInterface $request) { |
|
| 62 | 1 | throw new \Exception('The first middleware in the stack calls next when it shouldn\'t'); |
|
| 63 | 5 | }; |
|
| 64 | |||
| 65 | 5 | $response = call_user_func($this->middleware, $request, $next); |
|
| 66 | |||
| 67 | 4 | if (!$response instanceof ResponseInterface) { |
|
| 68 | 1 | throw new \Exception('Middleware is not returning a Response object'); |
|
| 69 | } |
||
| 70 | |||
| 71 | 3 | return $response; |
|
| 72 | } |
||
| 73 | } |
||
| 74 |
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..