2 namespace Robo\Task\Base;
6 use Robo\Task\BaseTask;
7 use Symfony\Component\Console\Command\Command;
8 use Symfony\Component\Console\Input\ArrayInput;
11 * Executes Symfony Command
16 * $this->taskSymfonyCommand(new \Codeception\Command\Run('run'))
17 * ->arg('suite','acceptance')
22 * $this->taskSymfonyCommand(new ModelGeneratorCommand())
23 * ->arg('name', 'User')
28 class SymfonyCommand extends BaseTask
31 * @var \Symfony\Component\Console\Command\Command
40 public function __construct(Command $command)
42 $this->command = $command;
48 * @param string $value
52 public function arg($arg, $value)
54 $this->input[$arg] = $value;
58 public function opt($option, $value = null)
60 $this->input["--$option"] = $value;
69 $this->printTaskInfo('Running command {command}', ['command' => $this->command->getName()]);
72 $this->command->run(new ArrayInput($this->input), Robo::output())