Jelajahi Sumber

Rename variable and field.

Daniele Alessandri 12 tahun lalu
induk
melakukan
36f8210864
1 mengubah file dengan 7 tambahan dan 5 penghapusan
  1. 7 5
      lib/Predis/Pipeline/StandardExecutor.php

+ 7 - 5
lib/Predis/Pipeline/StandardExecutor.php

@@ -26,12 +26,14 @@ use Predis\ServerException;
  */
 class StandardExecutor implements PipelineExecutorInterface
 {
+    protected $exceptions;
+
     /**
-     * @param bool $useServerExceptions Specifies if the executor should throw exceptions on server errors.
+     * @param bool $exceptions Specifies if the executor should throw exceptions on server errors.
      */
-    public function __construct($useServerExceptions = true)
+    public function __construct($exceptions = true)
     {
-        $this->useServerExceptions = (bool) $useServerExceptions;
+        $this->exceptions = (bool) $exceptions;
     }
 
     /**
@@ -70,7 +72,7 @@ class StandardExecutor implements PipelineExecutorInterface
     {
         $size = count($commands);
         $values = array();
-        $useServerExceptions = $this->useServerExceptions;
+        $exceptions = $this->exceptions;
 
         $this->checkConnection($connection);
 
@@ -81,7 +83,7 @@ class StandardExecutor implements PipelineExecutorInterface
         for ($i = 0; $i < $size; $i++) {
             $response = $connection->readResponse($commands->dequeue());
 
-            if ($response instanceof ResponseErrorInterface && $useServerExceptions === true) {
+            if ($response instanceof ResponseErrorInterface && $exceptions === true) {
                 $this->onResponseError($connection, $response);
             }