<?php
declare(strict_types=1); namespace App\Http; class Response { public static function json(array $data, int $statusCode = 200): void { if (!headers_sent()) { http_response_code($statusCode); header('Content-Type: application/json; charset=utf-8'); header('X-Content-Type-Options: nosniff'); header('X-Frame-Options: SAMEORIGIN'); header('X-XSS-Protection: 1; mode=block'); } echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } } 