Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 1 | public function getJsonResponse(ResponseInterface $response) |
|
31 | { |
||
32 | 1 | $response->withAddedHeader("content-type", "application/json"); |
|
33 | |||
34 | 1 | if ($response->getBody()->isWritable()) { |
|
35 | 1 | $response->getBody()->write(json_encode(["status-code" => $this->code, "reason-phrase" => $this->message])); |
|
36 | 1 | } |
|
37 | |||
38 | 1 | return $this->getResponse($response); |
|
39 | } |
||
40 | |||
41 | } |