| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function __invoke(ResponseInterface $response): DynamicModel |
||
| 28 | { |
||
| 29 | $data = Json::decodeIfJson( |
||
| 30 | $response->getBody()->getContents() |
||
| 31 | ); |
||
| 32 | |||
| 33 | if ($response->getStatusCode() === 200) { |
||
| 34 | return new DynamicModel(array_keys($data), $data); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $this->transformResponseErrors($response, $data); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |