| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 11 | public function transform(ResponseInterface $response): array |
|
| 22 | { |
||
| 23 | 11 | $body = (string) $response->getBody(); |
|
| 24 | 11 | $content = json_decode($body, true); |
|
| 25 | 11 | if (JSON_ERROR_NONE === json_last_error()) { |
|
| 26 | 10 | return $content; |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | throw new TransformResponseException($response, 'Error transforming response to array'); |
|
| 30 | } |
||
| 32 |