Robo\Robo::output PHP Method

output() public static method

Return the output object.
public static output ( ) : Symfony\Component\Console\Output\OutputInterface
return Symfony\Component\Console\Output\OutputInterface
    public static function output()
    {
        return static::service('output');
    }

Usage Example

Ejemplo n.º 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);
 }
All Usage Examples Of Robo\Robo::output