src/Cluster/ClusterStrategy.php
public function setCommandHandler($commandID, $callback = null)
    {
        $commandID = strtoupper($commandID);

        if (!isset($callback)) {
            unset($this->commands[$commandID]);

            return;
        }

        if (!is_callable($callback)) {
            throw new \InvalidArgumentException(
                'The argument must be a callable object or NULL.'
            );
        }

        $this->commands[$commandID] = $callback;
    }
public function setCommandHandler($commandID, $callback = null)
    {
        $commandID = strtoupper($commandID);

        if (!isset($callback)) {
            unset($this->commands[$commandID]);

            return;
        }

        if (!is_callable($callback)) {
            throw new \InvalidArgumentException(
                'The argument must be a callable object or NULL.'
            );
        }

        $this->commands[$commandID] = $callback;
    }
public function setCommandHandler ( $ commandID , $ callback = null ) { $ commandID = strtoupper ( $ commandID ) ; if ( ! isset ( $ callback ) ) { unset ( $ this -> commands [ $ commandID ] ) ; return ; } if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( 'The argument must be a callable object or NULL.' ) ; } $ this -> commands [ $ commandID ] = $ callback ; }
Sets an handler for the specified command ID.

The signature of the callback must have a single parameter of type
Predis\Command\CommandInterface.

When the callback argument is omitted or NULL, the previously associated
handler for the specified command ID is removed.

@param string $commandID Command ID.
@param mixed  $callback  A valid callable object, or NULL to unset the handler.

@throws \InvalidArgumentException
Sets an handler for the specified command ID .