Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
27 | 11 | public function getResponse(GuzzleResponseInterface $response) |
|
28 | { |
||
29 | 11 | $body = json_decode($response->getBody(), true); |
|
30 | 11 | if (array_key_exists('results', $body)) { |
|
31 | 1 | $result = new ResponseCollection($response); |
|
32 | } else { |
||
33 | 10 | $result = new Response($response); |
|
34 | } |
||
35 | |||
36 | 11 | return $result; |
|
37 | } |
||
39 |