| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 3 | public function __invoke(callable $handler) |
|
| 32 | { |
||
| 33 | return function (RequestInterface $request, array $options) use ($handler) { |
||
| 34 | 2 | return $handler($request, $options) |
|
| 35 | ->then(function (ResponseInterface $response) { |
||
| 36 | 1 | return $response; |
|
| 37 | 2 | }, function (GuzzleException $exception) { |
|
| 38 | 1 | $this->collector->addException($exception); |
|
|
|
|||
| 39 | |||
| 40 | 1 | throw $exception; |
|
| 41 | 2 | }); |
|
| 42 | 3 | }; |
|
| 43 | } |
||
| 44 | } |
||
| 45 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: