Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | 10 | private function getNormalizedResponse(string $body) |
|
19 | { |
||
20 | 10 | $decodedResponse = $this->getJsonDecodedResponse($body); |
|
21 | |||
22 | 8 | if (!array_key_exists('data', $decodedResponse)) { |
|
23 | 4 | throw new \UnexpectedValueException('Invalid GraphQL JSON response.'); |
|
24 | } |
||
25 | |||
26 | return [ |
||
27 | 4 | 'data' => $decodedResponse['data'] ?? [], |
|
28 | 2 | 'errors' => $decodedResponse['errors'] ?? [], |
|
29 | ]; |
||
30 | } |
||
31 | |||
43 |