Skip to content

Commit e6ffc47

Browse files
loks0nclaude
andcommitted
Drop RouteMatch::withArguments(), use the constructor directly
The helper had a single caller (Http::execute() updating the arguments map after the action's params resolve) and the constructor already accepts \$arguments. Inline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4117939 commit e6ffc47

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

src/Http/Http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ public function execute(Route $route, Request $request, Response $response): sta
640640
foreach ($route->getParams() as $name => $param) {
641641
$resolved[$name] = $arguments[$param['order']] ?? null;
642642
}
643-
$match = $match->withArguments($resolved);
643+
$match = new RouteMatch($match->route, $match->path, $resolved);
644644
$this->setContext('match', fn() => $match);
645645

646646
\call_user_func_array($route->getAction(), $arguments);

src/Http/RouteMatch.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,4 @@ public function __construct(
2525
public readonly string $path,
2626
public readonly array $arguments = [],
2727
) {}
28-
29-
/**
30-
* Return a copy of this match with the resolved-argument map replaced.
31-
* Used by the framework once the action's parameters have been
32-
* validated, so subsequent shutdown / error hooks can read the same
33-
* values the action received.
34-
*
35-
* @param array<string, mixed> $arguments
36-
*/
37-
public function withArguments(array $arguments): self
38-
{
39-
return new self($this->route, $this->path, $arguments);
40-
}
4128
}

0 commit comments

Comments
 (0)