| Conditions | 6 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 73 | private function getJsonResponse(\GuzzleHttp\Psr7\Response $response): array |
||
| 74 | { |
||
| 75 | switch ($response->getStatusCode()) { |
||
| 76 | case 200: |
||
| 77 | $response = (string) $response->getBody(); |
||
| 78 | |||
| 79 | if (empty($response) || !isset($response) || $response == '') { |
||
| 80 | $response = '{}'; |
||
| 81 | } |
||
| 82 | break; |
||
| 83 | case 404: |
||
| 84 | $response = []; |
||
| 85 | break; |
||
| 86 | default: |
||
| 87 | $response = []; |
||
| 88 | break; |
||
| 89 | } |
||
| 90 | |||
| 91 | return json_decode($response, true); |
||
|
|
|||
| 92 | } |
||
| 93 | } |