Command/ListProcessCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $processConfigurations = $this->processConfigRegistry->getProcessConfigurations();
        \usort($processConfigurations, [$this, 'processSorter']);

        $publicCount = \array_reduce($processConfigurations, [$this, 'publicProcessCounter'], 0);
        $privateCount = \array_reduce($processConfigurations, [$this, 'privateProcessCounter'], 0);
        $output->writeln("<info>There are {$publicCount} process configurations defined (and {$privateCount} private) :</info>");

        $messages = [];
        foreach ($processConfigurations as $processConfiguration) {
            if ($processConfiguration->isPublic() || $input->getOption('all')) {
                $countTasks = \count($processConfiguration->getTaskConfigurations());
                $message = "<info> - </info>{$processConfiguration->getCode()}<info> with {$countTasks} tasks</info>";

                if ($processConfiguration->isPrivate()) {
                    $message .= " <comment>(private)</comment>";
                }

                $messages[] = [
                    'process' => $processConfiguration,
                    'output'  => $message,
                ];
            }
        }

        // Add process descriptions at a fixed position
        $maxMessageLength = \array_reduce($messages, [$this, 'maxMessageLengthFilter'], 0);
        $outputMessages = [];
        foreach ($messages as $message) {
            /** @var ProcessConfiguration $processConfiguration */
            $processConfiguration = $message['process'];
            $outputMessage = $message['output'];

            if ($processConfiguration->getDescription()) {
                $outputMessage = $this->padMessage($outputMessage, $maxMessageLength + 3);
                $outputMessage .= "{$processConfiguration->getDescription()}";
            }

            $outputMessages[] = $outputMessage;
        }

        // Output messages
        foreach ($outputMessages as $message) {
            $output->writeln($message);
        }
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $processConfigurations = $this->processConfigRegistry->getProcessConfigurations();
        \usort($processConfigurations, [$this, 'processSorter']);

        $publicCount = \array_reduce($processConfigurations, [$this, 'publicProcessCounter'], 0);
        $privateCount = \array_reduce($processConfigurations, [$this, 'privateProcessCounter'], 0);
        $output->writeln("<info>There are {$publicCount} process configurations defined (and {$privateCount} private) :</info>");

        $messages = [];
        foreach ($processConfigurations as $processConfiguration) {
            if ($processConfiguration->isPublic() || $input->getOption('all')) {
                $countTasks = \count($processConfiguration->getTaskConfigurations());
                $message = "<info> - </info>{$processConfiguration->getCode()}<info> with {$countTasks} tasks</info>";

                if ($processConfiguration->isPrivate()) {
                    $message .= " <comment>(private)</comment>";
                }

                $messages[] = [
                    'process' => $processConfiguration,
                    'output'  => $message,
                ];
            }
        }

        // Add process descriptions at a fixed position
        $maxMessageLength = \array_reduce($messages, [$this, 'maxMessageLengthFilter'], 0);
        $outputMessages = [];
        foreach ($messages as $message) {
            /** @var ProcessConfiguration $processConfiguration */
            $processConfiguration = $message['process'];
            $outputMessage = $message['output'];

            if ($processConfiguration->getDescription()) {
                $outputMessage = $this->padMessage($outputMessage, $maxMessageLength + 3);
                $outputMessage .= "{$processConfiguration->getDescription()}";
            }

            $outputMessages[] = $outputMessage;
        }

        // Output messages
        foreach ($outputMessages as $message) {
            $output->writeln($message);
        }
    }
{@inheritdoc}