Predis\Replication\ReplicationStrategy::isGeoradiusReadOnly PHP Method

isGeoradiusReadOnly() protected method

Checks if a GEORADIUS command is a readable operation by parsing the arguments array of the specified commad instance.
protected isGeoradiusReadOnly ( Predis\Command\CommandInterface $command ) : boolean
$command Predis\Command\CommandInterface Command instance.
return boolean
    protected function isGeoradiusReadOnly(CommandInterface $command)
    {
        $arguments = $command->getArguments();
        $argc = count($arguments);
        $startIndex = $command->getId() === 'GEORADIUS' ? 5 : 4;
        if ($argc > $startIndex) {
            for ($i = $startIndex; $i < $argc; ++$i) {
                $argument = strtoupper($arguments[$i]);
                if ($argument === 'STORE' || $argument === 'STOREDIST') {
                    return false;
                }
            }
        }
        return true;
    }