src/Replication/ReplicationStrategy.php
public function isReadOperation(CommandInterface $command)
    {
        if (isset($this->disallowed[$id = $command->getId()])) {
            throw new NotSupportedException(
                "The command '$id' is not allowed in replication mode."
            );
        }

        if (isset($this->readonly[$id])) {
            if (true === $readonly = $this->readonly[$id]) {
                return true;
            }

            return call_user_func($readonly, $command);
        }

        if (($eval = $id === 'EVAL') || $id === 'EVALSHA') {
            $sha1 = $eval ? sha1($command->getArgument(0)) : $command->getArgument(0);

            if (isset($this->readonlySHA1[$sha1])) {
                if (true === $readonly = $this->readonlySHA1[$sha1]) {
                    return true;
                }

                return call_user_func($readonly, $command);
            }
        }

        return false;
    }
public function isReadOperation(CommandInterface $command)
    {
        if (isset($this->disallowed[$id = $command->getId()])) {
            throw new NotSupportedException(
                "The command '$id' is not allowed in replication mode."
            );
        }

        if (isset($this->readonly[$id])) {
            if (true === $readonly = $this->readonly[$id]) {
                return true;
            }

            return call_user_func($readonly, $command);
        }

        if (($eval = $id === 'EVAL') || $id === 'EVALSHA') {
            $sha1 = $eval ? sha1($command->getArgument(0)) : $command->getArgument(0);

            if (isset($this->readonlySHA1[$sha1])) {
                if (true === $readonly = $this->readonlySHA1[$sha1]) {
                    return true;
                }

                return call_user_func($readonly, $command);
            }
        }

        return false;
    }
public function isReadOperation ( CommandInterface $ command ) { if ( isset ( $ this -> disallowed [ $ id = $ command -> getId ( ) ] ) ) { throw new NotSupportedException ( "The command '$id' is not allowed in replication mode." ) ; } if ( isset ( $ this -> readonly [ $ id ] ) ) { if ( true === $ readonly = $ this -> readonly [ $ id ] ) { return true ; } return call_user_func ( $ readonly , $ command ) ; } if ( ( $ eval = $ id === 'EVAL' ) || $ id === 'EVALSHA' ) { $ sha1 = $ eval ? sha1 ( $ command -> getArgument ( 0 ) ) : $ command -> getArgument ( 0 ) ; if ( isset ( $ this -> readonlySHA1 [ $ sha1 ] ) ) { if ( true === $ readonly = $ this -> readonlySHA1 [ $ sha1 ] ) { return true ; } return call_user_func ( $ readonly , $ command ) ; } } return false ; }
Returns if the specified command will perform a read-only operation
on Redis or not.

@param CommandInterface $command Command instance.

@throws NotSupportedException

@return bool
Returns if the specified command will perform a read - only operation on Redis or not .