output() публичный статический Метод

Return the output object.
public static output ( ) : Symfony\Component\Console\Output\OutputInterface
Результат Symfony\Component\Console\Output\OutputInterface
Пример #1
0
 /**
  * @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);
 }
Пример #2
0
 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);
 }
Пример #3
0
 public function testTasksStopOnFail()
 {
     $argv = ['placeholder', 'test:stop-on-fail'];
     $result = $this->runner->execute($argv, Robo::output());
     $this->guy->seeInOutput('[');
     $this->assertTrue($result > 0);
 }
Пример #4
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()));
 }