toArray() as $key => $value) { if (!is_string($value)) { return new Response(render(__DIR__ . '/../templates/error.html.php', [ 'message' => "Query parameter \"$key\" is not a string.", ]), 400); } } return $next($request); } }