/** * Applies the given property's post-process * callable method on the given value. * * If property has no post-process method, then * the value is returned. * * @param mixed $value * @param Property $property * * @return mixed */ public function applyPostProcessOn($value, Property $property) { if (!$property->hasPostProcess() && !$property->hasDefaultPostProcess()) { return $value; } $this->output->text("Applying post-process on <comment>{$property->getId()}</comment>"); $method = $property->getPostProcess(); return $method($value, $this->getPreviousAnswers()); }
/** * 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(''); }