| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function respond($callbackOrStatusCode = 200, $headers = []) |
||
| 31 | { |
||
| 32 | if (is_callable($callbackOrStatusCode)) { |
||
| 33 | $callbackOrStatusCode($this->response); |
||
| 34 | } else { |
||
| 35 | $this->response->code($callbackOrStatusCode); |
||
| 36 | $this->response->headers($headers); |
||
| 37 | } |
||
| 38 | |||
| 39 | return new JsonResponse($this->createData()->toArray(), $this->response->statusCode(), $this->response->getHeaders()); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |