| Conditions | 3 |
| Paths | 5 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 48 | public function send(RequestInterface $request, Target $target, string $action): ResponseInterface |
|
| 27 | { |
||
| 28 | try { |
||
| 29 | 48 | $response = $this->client->send($target->applyToRequest($request, $action)); |
|
| 30 | 42 | return $target->applyToResponse($response, $action); |
|
| 31 | 15 | } catch (RequestException $e) { |
|
| 32 | 15 | if ($e->getResponse() instanceof ResponseInterface) { |
|
| 33 | 15 | return $target->applyToResponse($e->getResponse(), $action); |
|
| 34 | } |
||
| 35 | throw $e; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 |