| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 12 | private function getJsonDecodedResponse(string $body) |
|
| 35 | { |
||
| 36 | 12 | $response = json_decode($body, true); |
|
| 37 | |||
| 38 | 12 | $error = json_last_error(); |
|
| 39 | 12 | if (JSON_ERROR_NONE !== $error) { |
|
| 40 | 2 | throw new \UnexpectedValueException( |
|
| 41 | 2 | 'Invalid JSON response. Response body: ' . $body |
|
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | 10 | return $response; |
|
| 46 | } |
||
| 47 | } |
||
| 48 |