Predis\Replication\ReplicationStrategy::isBitfieldReadOnly PHP Method

isBitfieldReadOnly() protected method

Checks if BITFIELD performs a read-only operation by looking for certain SET and INCRYBY modifiers in the arguments array of the command.
protected isBitfieldReadOnly ( Predis\Command\CommandInterface $command ) : boolean
$command Predis\Command\CommandInterface Command instance.
return boolean
    protected function isBitfieldReadOnly(CommandInterface $command)
    {
        $arguments = $command->getArguments();
        $argc = count($arguments);
        if ($argc >= 2) {
            for ($i = 1; $i < $argc; ++$i) {
                $argument = strtoupper($arguments[$i]);
                if ($argument === 'SET' || $argument === 'INCRBY') {
                    return false;
                }
            }
        }
        return true;
    }