فهرست منبع

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) {