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