public function remove(ProcessorInterface $processor) { if (false !== ($index = array_search($processor, $this->processors, true))) { unset($this[$index]); } }
/** * @group disconnected */ public function testRemoveProcessorFromEmptyChain() { $processor = $this->getMock('Predis\\Command\\Processor\\ProcessorInterface'); $chain = new ProcessorChain(); $this->assertEmpty($chain->getProcessors()); $chain->remove($processor); $this->assertEmpty($chain->getProcessors()); }