Predis\Cluster\ClusterStrategy::getKeyFromSortCommand PHP Метод

getKeyFromSortCommand() защищенный Метод

Extracts the key from SORT command.
protected getKeyFromSortCommand ( Predis\Command\CommandInterface $command ) : string | null
$command Predis\Command\CommandInterface Command instance.
Результат string | null
    protected function getKeyFromSortCommand(CommandInterface $command)
    {
        $arguments = $command->getArguments();
        $firstKey = $arguments[0];
        if (1 === ($argc = count($arguments))) {
            return $firstKey;
        }
        $keys = array($firstKey);
        for ($i = 1; $i < $argc; ++$i) {
            if (strtoupper($arguments[$i]) === 'STORE') {
                $keys[] = $arguments[++$i];
            }
        }
        if ($this->checkSameSlotForKeys($keys)) {
            return $firstKey;
        }
    }