refactor: parallel

This commit is contained in:
Nuno Maduro
2023-02-13 03:08:36 +00:00
parent 735f131222
commit b6fb81e506
7 changed files with 52 additions and 35 deletions

View File

@ -16,7 +16,7 @@ final class Parallel implements HandlesArguments
use HandleArguments;
/**
* @var string[]
* The list of arguments to remove.
*/
private const ARGS_TO_REMOVE = [
'--parallel',
@ -24,6 +24,9 @@ final class Parallel implements HandlesArguments
'--no-output',
];
/**
* Handles the arguments, removing the ones that are not needed, and adding the "runner" argument.
*/
public function handleArguments(array $arguments): array
{
$args = array_reduce(self::ARGS_TO_REMOVE, fn ($args, $arg): array => $this->popArgument($arg, $args), $arguments);