Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
63 | public function respond(int $status, string $body, array $headers = []): void |
||
64 | { |
||
65 | if (empty($headers)) { |
||
66 | // this is required to represent empty header set as map and not as array |
||
67 | $headers = new \stdClass(); |
||
68 | } |
||
69 | |||
70 | $this->getWorker()->send( |
||
71 | $body, |
||
72 | (string) json_encode(['status' => $status, 'headers' => $headers]) |
||
73 | ); |
||
74 | } |
||
75 | } |
||
76 |