| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | 3 | protected function getResponse(RequestInterface $request) |
|
| 50 | { |
||
| 51 | try { |
||
| 52 | /* @var $response \GuzzleHttp\Psr7\Response */ |
||
| 53 | 3 | $response = $this->getClient()->send($request); |
|
| 54 | 1 | } catch (GuzzleHttpException $ex) { |
|
| 55 | 1 | throw new Exception\RequestException('Could not get valid response from "' . $request->getUri() . '"', null, $ex); |
|
| 56 | } |
||
| 57 | |||
| 58 | 2 | if ($response->getStatusCode() !== 200) { |
|
| 59 | 1 | throw new Exception\RequestException('Could not get valid response from "' . $request->getUri() . '". Status code is: "' . $response->getStatusCode() . '"'); |
|
| 60 | } |
||
| 61 | |||
| 62 | 1 | return $response; |
|
| 63 | } |
||
| 64 | } |
||
| 65 |