Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function addInitRoboFileCommand($roboFile, $roboClass)
);
$output->writeln("<comment> Edit this file to add your commands! </comment>");
});
$this->add($createRoboFile);
$this->addCommand($createRoboFile);
}

/**
Expand All @@ -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);
}
}
4 changes: 2 additions & 2 deletions src/Robo.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,15 @@ 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;
}

// Register commands for all of the public methods in the RoboFile.
$commandFactory = $container->get('commandFactory');
$commandList = $commandFactory->createCommandsFromClass($instance);
foreach ($commandList as $command) {
$app->add($command);
$app->addCommand($command);
}
return $instance;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 6 additions & 1 deletion src/Task/Base/ParallelExec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/RoboFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Loading