Skip to content

Commit

Permalink
fix variadic
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Feb 9, 2025
1 parent 3af8b21 commit 7e1d3dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Arguments.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,13 @@ private function assertValues(): void
$pos
);
} else {
$variadicKeys = array_diff(
$variadicKeys = array_filter(
array_keys($this->arguments),
$this->parameters->keys()
fn (string|int $key) => ! in_array($key, $this->parameters->keys(), true)
&& ! (is_int($key) && $key < $pos)
);
}

foreach ($variadicKeys as $id) {
try {
$this->assertSetArgument($name, $this->arguments[$id], $id);
Expand Down

0 comments on commit 7e1d3dd

Please sign in to comment.