Forráskód Böngészése

Exposed ResponseReader::setHandler as a public method and implemented ResponseReader::getHandler.

Daniele Alessandri 15 éve
szülő
commit
c8509dd068
1 módosított fájl, 7 hozzáadás és 1 törlés
  1. 7 1
      lib/Predis.php

+ 7 - 1
lib/Predis.php

@@ -542,10 +542,16 @@ class ResponseReader {
         );
     }
 
-    private function setHandler($prefix, IResponseHandler $handler) {
+    public function setHandler($prefix, IResponseHandler $handler) {
         $this->_prefixHandlers[$prefix] = $handler;
     }
 
+    public function getHandler($prefix) {
+        if (isset($this->_prefixHandlers[$prefix])) {
+            return $this->_prefixHandlers[$prefix];
+        }
+    }
+
     public function setOption($option, $value) {
         switch ($option) {
             case 'iterable_multibulk_replies':