| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | trait ContainerResponseTrait |
||
| 19 | { |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @codeCoverageIgnore |
||
| 23 | * @param array $data |
||
| 24 | */ |
||
| 25 | public function jsonResponse(array $data): void |
||
| 26 | { |
||
| 27 | header('Content-Type: application/json'); |
||
| 28 | echo $this->getJson($data); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param array $data |
||
| 33 | * @return string |
||
| 34 | */ |
||
| 35 | protected function getJson(array $data): string |
||
| 38 | } |
||
| 39 | } |
||
| 40 |