0) { http_response_code($responseCode); } static::$headers[] = $value; } public static function setcookie( string $name, string $value = '', int $expires = 0, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false ): void { static::$cookies[$name] = $value; } public static function reset(): void { static::$headers = []; static::$cookies = []; } public static function headerValue(string $prefix): ?string { foreach (static::$headers as $header) { if (stripos($header, $prefix) === 0) { return substr($header, strlen($prefix)); } } return null; } public static function hasHeader(string $prefix): bool { return static::headerValue($prefix) !== null; } }