yii\console\controllers\HelpController::getCommandDescriptions PHP Method

getCommandDescriptions() protected method

Returns an array of commands an their descriptions.
protected getCommandDescriptions ( ) : array
return array all available commands as keys and their description as values.
    protected function getCommandDescriptions()
    {
        $descriptions = [];
        foreach ($this->getCommands() as $command) {
            $description = '';
            $result = Yii::$app->createController($command);
            if ($result !== false && $result[0] instanceof Controller) {
                list($controller, $actionID) = $result;
                /** @var Controller $controller */
                $description = $controller->getHelpSummary();
            }
            $descriptions[$command] = $description;
        }
        return $descriptions;
    }