Tighten param reconstruction

Use Request::getParam() for the query/body+default fallback instead of a
cached getParams() copy, dropping the temporary and shortening the diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
loks0nandClaude Opus 4.8 committed 2026-06-01 16:18:00 +01:00
1 parent ad7a76abbb
commit 0bf406e597
1 file changed
+3 -6
+3 -6
View File
@@ -863,14 +863,11 @@ Http::shutdown()
}
}
// $params holds the URL path values (injected from the route match);
// merge in query/body params and declared defaults to reproduce the
// full resolved param set, with path values taking precedence.
$reqParams = $request->getParams();
// Reproduce the resolved param set: injected path values take precedence
// over query/body params, falling back to each param's declared default.
$requestParams = [];
foreach ($route->getParams() as $key => $param) {
$requestParams[$key] = $params[$key] ?? $reqParams[$key] ?? $param['default'];
$requestParams[$key] = $params[$key] ?? $request->getParam($key, $param['default']);
}
/**