fix: popArgument drops duplicate arguments breaking --parallel --exclude-gropup= (#1674)

* fix: popArgument drops duplicate arguments breaking --parallel multi-exclude-group

Fixes #1437

* fix: ensure popArgument handles duplicate arguments

* fix: update expected test results and snapshots after rebase

---------

Signed-off-by: nuno maduro <enunomaduro@gmail.com>
Co-authored-by: nuno maduro <enunomaduro@gmail.com>
This commit is contained in:
flap152
2026-06-12 12:58:37 -04:00
committed by GitHub
parent 97714a7088
commit 8467c64c22
5 changed files with 49 additions and 8 deletions
+6 -3
View File
@@ -50,11 +50,14 @@ trait HandleArguments
*/
public function popArgument(string $argument, array $arguments): array
{
$arguments = array_flip($arguments);
$key = array_search($argument, $arguments, true);
unset($arguments[$argument]);
while ($key !== false) {
unset($arguments[$key]);
$key = array_search($argument, $arguments, true);
}
return array_values(array_flip($arguments));
return array_values($arguments);
}
/**