Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
55 | 4 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response) |
|
56 | { |
||
57 | 4 | if (!$this->middleware) { |
|
58 | 3 | return $response; |
|
59 | } |
||
60 | |||
61 | 3 | $result = call_user_func($this->middleware, $request, $response, $this->next); |
|
62 | 3 | if (!$result instanceof ResponseInterface) { |
|
63 | 1 | $result = $response; |
|
64 | 1 | } |
|
65 | |||
66 | 3 | return $result; |
|
67 | } |
||
68 | } |
||
69 |