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