| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | function psr7_response_encode(ResponseInterface $response): array |
||
| 14 | { |
||
| 15 | 2 | $json = []; |
|
| 16 | 2 | $json['protocol_version'] = $response->getProtocolVersion(); |
|
| 17 | 2 | $json['status_code'] = $response->getStatusCode(); |
|
| 18 | 2 | $json['reason_phrase'] = $response->getReasonPhrase(); |
|
| 19 | 2 | $json['headers'] = $response->getHeaders(); |
|
| 20 | 2 | $json['body'] = $response->getBody()->getContents(); |
|
| 21 | |||
| 22 | 2 | return $json; |
|
| 23 | } |
||
| 60 |