Predis\Command\Processor\KeyPrefixProcessor::process PHP Метод

process() публичный Метод

public process ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface
    public function process(CommandInterface $command)
    {
        if ($command instanceof PrefixableCommandInterface) {
            $command->prefixKeys($this->prefix);
        } elseif (isset($this->commands[$commandID = strtoupper($command->getId())])) {
            call_user_func($this->commands[$commandID], $command, $this->prefix);
        }
    }

Usage Example

Пример #1
0
 /**
  * @group disconnected
  */
 public function testSkipNotPrefixableCommands()
 {
     $prefix = 'prefix:';
     $unprefixed = 'key';
     $expected = "{$prefix}{$unprefixed}";
     $command = $this->getMock('Predis\\Command\\CommandInterface');
     $command->expects($this->never())->method('prefixKeys');
     $processor = new KeyPrefixProcessor($prefix);
     $processor->process($command);
 }