diff --git a/src/Application.php b/src/Application.php index dbdd6a4a..a68e0e67 100644 --- a/src/Application.php +++ b/src/Application.php @@ -56,7 +56,7 @@ public function addInitRoboFileCommand($roboFile, $roboClass) ); $output->writeln(" Edit this file to add your commands! "); }); - $this->add($createRoboFile); + $this->addCommand($createRoboFile); } /** @@ -71,6 +71,6 @@ public function addSelfUpdateCommand($repository = null) return; } $selfUpdateCommand = new \SelfUpdate\SelfUpdateCommand($this->getName(), $this->getVersion(), $repository); - $this->add($selfUpdateCommand); + $this->addCommand($selfUpdateCommand); } } diff --git a/src/Robo.php b/src/Robo.php index 25cb7884..0c4e5267 100644 --- a/src/Robo.php +++ b/src/Robo.php @@ -547,7 +547,7 @@ protected static function registerSingle($app, $handler) // If the instance is a Symfony Command, register it with // the application if ($instance instanceof Command) { - $app->add($instance); + $app->addCommand($instance); return $instance; } @@ -555,7 +555,7 @@ protected static function registerSingle($app, $handler) $commandFactory = $container->get('commandFactory'); $commandList = $commandFactory->createCommandsFromClass($instance); foreach ($commandList as $command) { - $app->add($command); + $app->addCommand($command); } return $instance; } diff --git a/src/Runtime/Runner.php b/src/Runtime/Runner.php index c345ba02..2eea95af 100644 --- a/src/Runtime/Runner.php +++ b/src/Runtime/Runner.php @@ -353,7 +353,7 @@ public function registerCommandClass($app, $commandClass) $commandFactory = $container->get('commandFactory'); $commandList = $commandFactory->createCommandsFromClass($roboCommandFileInstance); foreach ($commandList as $command) { - $app->add($command); + $app->addCommand($command); } return $roboCommandFileInstance; } diff --git a/src/Task/Base/ParallelExec.php b/src/Task/Base/ParallelExec.php index ea21da5a..b8a228f1 100644 --- a/src/Task/Base/ParallelExec.php +++ b/src/Task/Base/ParallelExec.php @@ -84,12 +84,17 @@ public function printed($isPrinted = true) } /** - * @param string|\Robo\Contract\CommandInterface $command + * @param string|\Robo\Contract\CommandInterface|Process $command * * @return $this */ public function process($command) { + if ($command instanceof Process) { + $this->processes[] = $command; + return $this; + } + // TODO: Symfony 4 requires that we supply the working directory. $this->processes[] = Process::fromShellCommandline($this->receiveCommand($command), getcwd()); return $this; diff --git a/tests/integration/RoboFileTest.php b/tests/integration/RoboFileTest.php index a2cef8a7..b4f2d37a 100644 --- a/tests/integration/RoboFileTest.php +++ b/tests/integration/RoboFileTest.php @@ -35,7 +35,7 @@ public function setUp(): void $this->roboCommandFileInstance->setBuilder($builder); $commandList = $this->commandFactory->createCommandsFromClass($this->roboCommandFileInstance); foreach ($commandList as $command) { - $this->app->add($command); + $this->app->addCommand($command); } } diff --git a/tests/unit/ApplicationTest.php b/tests/unit/ApplicationTest.php index d01082d2..4d6b8a29 100644 --- a/tests/unit/ApplicationTest.php +++ b/tests/unit/ApplicationTest.php @@ -39,7 +39,7 @@ protected function _before() $this->roboCommandFileInstance->setBuilder($builder); $commandList = $this->commandFactory->createCommandsFromClass($this->roboCommandFileInstance); foreach ($commandList as $command) { - $this->app->add($command); + $this->app->addCommand($command); } }