Predis\Command\Processor\KeyPrefixProcessor::georadius PHP Метод

georadius() публичный статический Метод

Applies the specified prefix to the key of a GEORADIUS command.
public static georadius ( Predis\Command\CommandInterface $command, string $prefix )
$command Predis\Command\CommandInterface Command instance.
$prefix string Prefix string.
    public static function georadius(CommandInterface $command, $prefix)
    {
        if ($arguments = $command->getArguments()) {
            $arguments[0] = "{$prefix}{$arguments[0]}";
            $startIndex = $command->getId() === 'GEORADIUS' ? 5 : 4;
            if (($count = count($arguments)) > $startIndex) {
                for ($i = $startIndex; $i < $count; ++$i) {
                    switch (strtoupper($arguments[$i])) {
                        case 'STORE':
                        case 'STOREDIST':
                            $arguments[$i] = "{$prefix}{$arguments[++$i]}";
                            break;
                    }
                }
            }
            $command->setRawArguments($arguments);
        }
    }