Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/Cli/ParallelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,26 @@ private function startPoll(): void
*/
private function createTasks()
{
$path = $this->input->hasArgument('paths') ? $this->input->getArgument('paths') : null;
if (! is_string($path) && $path !== null) {
throw new UnexpectedValue('Expected string or null');
$paths = $this->input->hasArgument('paths') ? $this->input->getArgument('paths') : null;

if (is_null($paths) || is_string($paths)) {
return $this->taskFactory->createTasks($this->input, $paths);
}

if (!is_array($paths)) {
throw new UnexpectedValue('Expected array, string or null');
}

if (empty($paths)) {
return $this->taskFactory->createTasks($this->input, null);
}

$tasks = [];
foreach ($paths as $path) {
$tasks = array_merge($tasks, $this->taskFactory->createTasks($this->input, $path));
}

return $this->taskFactory->createTasks($this->input, $path);
return $tasks;
}

/**
Expand Down
Loading