| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | protected function json($data, int $status = 200, array $headers = [], array $context = []) : JsonResponse |
||
| 34 | { |
||
| 35 | if ($this->serializer) { |
||
| 36 | $data = $this->serializer->serialize($data, 'json', array_merge([ |
||
| 37 | 'json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS, |
||
| 38 | ], $context)); |
||
| 39 | } |
||
| 40 | |||
| 41 | return new JsonResponse($data, $status, $headers, true); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |