Predis\Command\Processor\ProcessorChain::process PHP Méthode

process() public méthode

public process ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface
    public function process(CommandInterface $command)
    {
        for ($i = 0; $i < ($count = count($this->processors)); ++$i) {
            $this->processors[$i]->process($command);
        }
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testProcessChain()
 {
     $command = $this->getMock('Predis\\Command\\CommandInterface');
     $processor1 = $this->getMock('Predis\\Command\\Processor\\ProcessorInterface');
     $processor1->expects($this->once())->method('process')->with($command);
     $processor2 = $this->getMock('Predis\\Command\\Processor\\ProcessorInterface');
     $processor2->expects($this->once())->method('process')->with($command);
     $processors = array($processor1, $processor2);
     $chain = new ProcessorChain($processors);
     $chain->process($command);
 }