Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
19 | public function __invoke(ResourceObject $ro, array $server) |
||
20 | { |
||
21 | unset($server); |
||
22 | // render |
||
23 | if (! $ro->view) { |
||
24 | $ro->toString(); |
||
25 | } |
||
26 | |||
27 | // header |
||
28 | foreach ($ro->headers as $label => $value) { |
||
29 | header("{$label}: {$value}", false); |
||
30 | } |
||
31 | |||
32 | // code |
||
33 | http_response_code($ro->code); |
||
34 | |||
35 | // body |
||
36 | echo $ro->view; |
||
37 | } |
||
39 |