Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.1755 |
Changes | 0 |
1 | <?php |
||
22 | 15 | public function request(HttpClientRequest $request): HttpClientResponse |
|
23 | { |
||
24 | try { |
||
25 | 15 | $response = $this->client->request($request->getMethod(), $request->getUri(), $request->options()); |
|
26 | 4 | } catch (RequestException $exception) { |
|
27 | 4 | if (! $exception->hasResponse()) { |
|
28 | 2 | throw HttpClientException::fromThrowable($exception); |
|
29 | } |
||
30 | |||
31 | 2 | $response = $exception->getResponse(); |
|
32 | } catch (TransferException $exception) { |
||
33 | throw HttpClientException::fromThrowable($exception); |
||
34 | } |
||
35 | |||
36 | 13 | return new GuzzleResponse($response); |
|
37 | } |
||
39 |