Example #1
0
 /**
  * Outputs the handler that has been applied (resolved), but
  * only if the given handler is not the same as the last
  * handler.
  *
  * @param \Aedart\Scaffold\Contracts\Handlers\Handler $handler
  */
 protected function outputAppliedHandler($handler)
 {
     $handlerClass = get_class($handler);
     if ($handlerClass != $this->lastHandler) {
         $this->lastHandler = $handlerClass;
         $this->output->text("Using handler: {$handlerClass}");
     }
 }
Example #2
0
 private function renderException(OutputInterface $output, $template, \Twig_Error $exception, $file = null)
 {
     $line = $exception->getTemplateLine();
     if ($file) {
         $output->text(sprintf('<error> ERROR </error> in %s (line %s)', $file, $line));
     } else {
         $output->text(sprintf('<error> ERROR </error> (line %s)', $line));
     }
     foreach ($this->getContext($template, $line) as $lineNumber => $code) {
         $output->text(sprintf('%s %-6s %s', $lineNumber === $line ? '<error> >> </error>' : '    ', $lineNumber, $code));
         if ($lineNumber === $line) {
             $output->text(sprintf('<error> >> %s</error> ', $exception->getRawMessage()));
         }
     }
 }
Example #3
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('');
 }