Command/ProcessHelpCommand.php
protected function getTaskChildrenCount(TaskConfiguration $task)
    {
        $count = 0;

        foreach ($task->getNextTasksConfigurations() as $nextTasksConfiguration) {
            $count += 1 + $this->getTaskChildrenCount($nextTasksConfiguration);
        }

        foreach ($task->getErrorTasksConfigurations() as $errorTasksConfiguration) {
            $count += 1 + $this->getTaskChildrenCount($errorTasksConfiguration);
        }

        return $count;
    }
protected function getTaskChildrenCount(TaskConfiguration $task)
    {
        $count = 0;

        foreach ($task->getNextTasksConfigurations() as $nextTasksConfiguration) {
            $count += 1 + $this->getTaskChildrenCount($nextTasksConfiguration);
        }

        foreach ($task->getErrorTasksConfigurations() as $errorTasksConfiguration) {
            $count += 1 + $this->getTaskChildrenCount($errorTasksConfiguration);
        }

        return $count;
    }
Get the number of children (error or not) of a task

@param TaskConfiguration $task

@return int