| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function parseResponseData($data): void |
||
| 44 | { |
||
| 45 | if (!is_string($data)) { |
||
| 46 | throw new \RuntimeException(sprintf("Cannot parse response data of type '%s', expected a string.", gettype($data))); |
||
| 47 | } |
||
| 48 | |||
| 49 | $json = json_decode($data, true); |
||
| 50 | |||
| 51 | if (!is_array($json)) { |
||
| 52 | throw new \RuntimeException(sprintf("Failed decoding of JSON response data: %s", json_last_error_msg())); |
||
| 53 | } |
||
| 54 | |||
| 55 | $this->json = $json; |
||
| 56 | } |
||
| 58 |