Command/ProcessHelpCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->getFormatter()->setStyle('fire', new OutputFormatterStyle('red'));

        $processCode = $input->getArgument('process_code');
        $process = $this->processConfigRegistry->getProcessConfiguration($processCode);

        $output->writeln("<comment>Process: </comment>");
        $output->writeln(str_repeat(' ', self::INDENT_SIZE) . $processCode);
        $output->writeln('');

        if ($process->getDescription()) {
            $output->writeln("<comment>Description:</comment>");
            $output->writeln(str_repeat(' ', self::INDENT_SIZE) . $process->getDescription());
            $output->writeln('');
        }

        if ($process->getHelp()) {
            $output->writeln("<comment>Help:</comment>");
            $helpLines = array_filter(explode("\n", $process->getHelp()));
            foreach ($helpLines as $helpLine) {
                $output->writeln(str_repeat(' ', self::INDENT_SIZE) . $helpLine);
            }
            $output->writeln('');
        }

        $output->writeln("<comment>Tasks tree:</comment>");

        $branches = [];

        $taskList = $process->getMainTaskGroup();
        $remainingTasks = $taskList;
        $totalBranches = \count($taskList);
        for ($i = 0; $i < $totalBranches; $i++) {
            // Find the best task to display
            $nextTaskCode = $this->findBestNextTask($branches, $remainingTasks, $process);

            $this->resolveBranchOutput($branches, $nextTaskCode, $process, $output);

            // Remove the task from the remaining list
            $remainingTasks = array_filter($remainingTasks, function ($task) use ($nextTaskCode) {
                return $task != $nextTaskCode;
            });
        }

        $branches = array_filter($branches);
        if (!empty($branches)) {
            $branchStr = '[' . implode(', ', $branches) . ']';
            $output->writeln("<error>All branches are not resolved : {$branchStr}</error>");
        }
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->getFormatter()->setStyle('fire', new OutputFormatterStyle('red'));

        $processCode = $input->getArgument('process_code');
        $process = $this->processConfigRegistry->getProcessConfiguration($processCode);

        $output->writeln("<comment>Process: </comment>");
        $output->writeln(str_repeat(' ', self::INDENT_SIZE) . $processCode);
        $output->writeln('');

        if ($process->getDescription()) {
            $output->writeln("<comment>Description:</comment>");
            $output->writeln(str_repeat(' ', self::INDENT_SIZE) . $process->getDescription());
            $output->writeln('');
        }

        if ($process->getHelp()) {
            $output->writeln("<comment>Help:</comment>");
            $helpLines = array_filter(explode("\n", $process->getHelp()));
            foreach ($helpLines as $helpLine) {
                $output->writeln(str_repeat(' ', self::INDENT_SIZE) . $helpLine);
            }
            $output->writeln('');
        }

        $output->writeln("<comment>Tasks tree:</comment>");

        $branches = [];

        $taskList = $process->getMainTaskGroup();
        $remainingTasks = $taskList;
        $totalBranches = \count($taskList);
        for ($i = 0; $i < $totalBranches; $i++) {
            // Find the best task to display
            $nextTaskCode = $this->findBestNextTask($branches, $remainingTasks, $process);

            $this->resolveBranchOutput($branches, $nextTaskCode, $process, $output);

            // Remove the task from the remaining list
            $remainingTasks = array_filter($remainingTasks, function ($task) use ($nextTaskCode) {
                return $task != $nextTaskCode;
            });
        }

        $branches = array_filter($branches);
        if (!empty($branches)) {
            $branchStr = '[' . implode(', ', $branches) . ']';
            $output->writeln("<error>All branches are not resolved : {$branchStr}</error>");
        }
    }
{@inheritdoc}

@throws \Psr\Container\NotFoundExceptionInterface
@throws \Psr\Container\ContainerExceptionInterface
@throws \UnexpectedValueException
@throws \Symfony\Component\Console\Exception\InvalidArgumentException
@throws \CleverAge\ProcessBundle\Exception\MissingProcessException
@throws \CleverAge\ProcessBundle\Exception\MissingTaskConfigurationException
@throws \InvalidArgumentException