Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
40 | 1 | public function format($data) : ResponseInterface |
|
41 | { |
||
42 | /** @var ResponseInterface $response */ |
||
43 | 1 | $response = $this->getContainer()->get('fuel.application.response'); |
|
44 | |||
45 | return $response |
||
46 | 1 | ->withBody(new CallbackStream( |
|
47 | 1 | function() use ($data) { |
|
48 | 1 | return json_encode($data); |
|
49 | 1 | } |
|
50 | )) |
||
51 | 1 | ->withHeader('Content-Type', 'application/json'); |
|
52 | } |
||
53 | } |
||
54 |