Conditions | 1 |
Paths | 2 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
49 | 9 | protected function doHandleRequest(RequestInterface $request, callable $next, callable $first) |
|
|
|||
50 | { |
||
51 | 9 | $stack = new Stack($this->client, $this->formatter->formatRequest($request)); |
|
52 | |||
53 | 9 | $this->collector->addStack($stack); |
|
54 | 9 | $this->collector->activateStack($stack); |
|
55 | |||
56 | $onFulfilled = function (ResponseInterface $response) use ($stack) { |
||
57 | 5 | $stack->setResponse($this->formatter->formatResponse($response)); |
|
58 | |||
59 | 5 | return $response; |
|
60 | 9 | }; |
|
61 | |||
62 | $onRejected = function (Exception $exception) use ($stack) { |
||
63 | 1 | $stack->setResponse($this->formatter->formatException($exception)); |
|
64 | 1 | $stack->setFailed(true); |
|
65 | |||
66 | 1 | throw $exception; |
|
67 | 9 | }; |
|
68 | |||
69 | try { |
||
70 | 9 | return $next($request)->then($onFulfilled, $onRejected); |
|
71 | } finally { |
||
72 | 9 | $this->collector->deactivateStack($stack); |
|
73 | } |
||
74 | } |
||
75 | } |
||
76 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.