| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 10 | private function getJsonDecodedResponse(string $body) |
|
| 33 | { |
||
| 34 | 10 | $response = json_decode($body, true); |
|
| 35 | |||
| 36 | 10 | $error = json_last_error(); |
|
| 37 | 10 | if (JSON_ERROR_NONE !== $error) { |
|
| 38 | 2 | throw new \UnexpectedValueException('Invalid JSON response.'); |
|
| 39 | } |
||
| 40 | 8 | return $response; |
|
| 41 | } |
||
| 42 | } |
||
| 43 |