think\console\output\descriptor\Console::sortCommands PHP Метод

sortCommands() приватный Метод

private sortCommands ( array $commands ) : array
$commands array
Результат array
    private function sortCommands(array $commands)
    {
        $namespacedCommands = [];
        foreach ($commands as $name => $command) {
            $key = $this->console->extractNamespace($name, 1);
            if (!$key) {
                $key = self::GLOBAL_NAMESPACE;
            }
            $namespacedCommands[$key][$name] = $command;
        }
        ksort($namespacedCommands);
        foreach ($namespacedCommands as &$commandsSet) {
            ksort($commandsSet);
        }
        // unset reference to keep scope clear
        unset($commandsSet);
        return $namespacedCommands;
    }