Read JSON body (empty array if not valid). */
()
| 115 | |
| 116 | /** Read JSON body (empty array if not valid). */ |
| 117 | private static function readJson(): array |
| 118 | { |
| 119 | $raw = file_get_contents('php://input'); |
| 120 | $data = json_decode($raw, true); |
| 121 | return is_array($data) ? $data : []; |
| 122 | } |
| 123 | |
| 124 | /** Convenience: set JSON content type + no-store. */ |
| 125 | private static function jsonHeaders(): void |
no outgoing calls
no test coverage detected