Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, array $args) |
||
31 | { |
||
32 | $result = $this->invoke($request, $response, $args); |
||
33 | |||
34 | $response->withAddedHeader('Content-Type', 'application/json'); |
||
35 | |||
36 | if ($response->getBody()->isWritable()) { |
||
37 | $response->getBody()->write(json_encode($result)); |
||
38 | } |
||
39 | |||
40 | return $response->withStatus(isset($result['status_code']) ? $result['status_code'] : 200); |
||
41 | } |
||
42 | } |
||
43 |