Predis\Replication\ReplicationStrategy::isSortReadOnly PHP Method

isSortReadOnly() protected method

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