Neos\Flow\Command\HelpCommandController::buildCommandsIndex PHP Method

buildCommandsIndex() protected method

Builds an index of available commands. For each of them a Command object is added to the commands array of this class.
protected buildCommandsIndex ( array $commands ) : array
$commands array
return array in the format array('' => array('', array('' => $command1, '' => $command2)))
    protected function buildCommandsIndex(array $commands)
    {
        $commandsByPackagesAndControllers = [];
        /** @var Command $command */
        foreach ($commands as $command) {
            if ($command->isInternal()) {
                continue;
            }
            $commandIdentifier = $command->getCommandIdentifier();
            $packageKey = strstr($commandIdentifier, ':', true);
            $commandControllerClassName = $command->getControllerClassName();
            $commandName = $command->getControllerCommandName();
            $commandsByPackagesAndControllers[$packageKey][$commandControllerClassName][$commandName] = $command;
        }
        return $commandsByPackagesAndControllers;
    }