Skip to content

Commit 8db8e56

Browse files
loks0nclaude
andcommitted
Refactor: consolidate route container write in match()
match() already writes the matched route to the per-request container, and runInternal() redundantly wrote it again right after calling match. For the no-match case the duplicate write stored a null factory that getRoute() already handles by returning null when the key is missing. Drop the second write so match() is the single owner of the route resource; the wildcard branch still sets it directly since it produces its own cloned route. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 441bfed commit 8db8e56

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/Http/Http.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,6 @@ private function runInternal(Request $request, Response $response): static
918918
$route = $this->match($request);
919919
$groups = ($route instanceof Route) ? $route->getGroups() : [];
920920

921-
$this->setRequestResource('route', fn () => $route, []);
922-
923921
if (self::REQUEST_METHOD_HEAD == $method) {
924922
$method = self::REQUEST_METHOD_GET;
925923
$response->disablePayload();

0 commit comments

Comments
 (0)