Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
29 | 27 | public function guzzleRequest($method, $uri = null, array $options = [], $asJson = true) |
|
30 | { |
||
31 | 27 | $response = parent::request($method, $uri, $options); |
|
32 | |||
33 | 27 | if ($response->getStatusCode() !== 200) { |
|
34 | 7 | ErrorHandler::handleErrorResponse($response); |
|
35 | } |
||
36 | |||
37 | 27 | if ($asJson) { |
|
38 | 27 | return json_decode($response->getBody(), true); |
|
39 | } |
||
40 | |||
41 | 4 | return $response->getBody()->getContents(); |
|
42 | } |
||
44 |