소스 검색

Actually implement preprocessor removal from a preprocessor chain.

Daniele Alessandri 14 년 전
부모
커밋
ae96b0f39f
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      lib/Predis/Commands/Preprocessors/PreprocessorChain.php

+ 4 - 1
lib/Predis/Commands/Preprocessors/PreprocessorChain.php

@@ -16,7 +16,10 @@ class PreprocessorChain implements ICommandPreprocessorChain, \ArrayAccess {
     }
 
     public function remove(ICommandPreprocessor $preprocessor) {
-        // TODO: find index of value
+        $index = array_search($preprocessor, $this->_preprocessors, true);
+        if ($index !== false) {
+            unset($this->_preprocessors);
+        }
     }
 
     public function process(&$method, &$arguments) {