Return the output object.
public static output ( ) : Symfony\Component\Console\Output\OutputInterface | ||
return | Symfony\Component\Console\Output\OutputInterface |
/** * @param string $roboFile * @param string $roboClass */ public function addInitRoboFileCommand($roboFile, $roboClass) { $createRoboFile = new Command('init'); $createRoboFile->setDescription("Intitalizes basic RoboFile in current dir"); $createRoboFile->setCode(function () use($roboClass, $roboFile) { $output = Robo::output(); $output->writeln("<comment> ~~~ Welcome to Robo! ~~~~ </comment>"); $output->writeln("<comment> " . basename($roboFile) . " will be created in the current directory </comment>"); file_put_contents($roboFile, '<?php' . "\n/**" . "\n * This is project's console commands configuration for Robo task runner." . "\n *" . "\n * @see http://robo.li/" . "\n */" . "\nclass " . $roboClass . " extends \\Robo\\Tasks\n{\n // define public methods as commands\n}"); $output->writeln("<comment> Edit this file to add your commands! </comment>"); }); $this->add($createRoboFile); }
protected function registerRoboFileCommands($app) { if (!$this->loadRoboFile()) { $this->yell("Robo is not initialized here. Please run `robo init` to create a new RoboFile", 40, 'yellow'); $app->addInitRoboFileCommand($this->roboFile, $this->roboClass); $app->run(Robo::input(), Robo::output()); return; } $this->registerCommandClasses($app, $this->roboClass); }
public function testTasksStopOnFail() { $argv = ['placeholder', 'test:stop-on-fail']; $result = $this->runner->execute($argv, Robo::output()); $this->guy->seeInOutput('['); $this->assertTrue($result > 0); }
/** * {@inheritdoc} */ public function run() { $this->printTaskInfo('Running command {command}', ['command' => $this->command->getName()]); return new Result($this, $this->command->run(new ArrayInput($this->input), Robo::output())); }