Example #1
0
 /**
  * Output execution status information to the console
  *
  * @param OutputInterface|StyleInterface $output
  * @param ConsoleTask $task
  * @param int $number The number of the task to be executed
  * @param int $total The total amount of tasks to be executed
  */
 protected function outputExecutionInfo($output, ConsoleTask $task, $number, $total)
 {
     $taskXofY = "Task ({$number}/{$total})";
     // Special formatting, if Symfony Style is provided
     if ($output instanceof StyleInterface) {
         $output->section($task->getName());
         $output->text($task->getDescription());
         $output->text($taskXofY);
         $output->newLine();
         return;
     }
     // Std. formatting
     $output->writeln($task->getName());
     $output->writeln('--------------------------------');
     $output->writeln($task->getDescription());
     $output->writeln($taskXofY);
     $output->writeln('');
 }