Преглед на файлове

Switch to protected visibility for some members of Predis\Client.

The "profile" member is actually used for caching purposes as fetching
its value from the options instance would add noticeable overhead in a
part of the client where every bit of optimization matters, for this
we decided to keep it private.
Daniele Alessandri преди 11 години
родител
ревизия
b45ba55f46
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      lib/Predis/Client.php

+ 4 - 4
lib/Predis/Client.php

@@ -34,9 +34,9 @@ class Client implements ClientInterface
 {
     const VERSION = '0.9.0-dev';
 
-    private $options;
+    protected $connection;
+    protected $options;
     private $profile;
-    private $connection;
 
     /**
      * Initializes a new client with optional connection parameters and client options.
@@ -46,9 +46,9 @@ class Client implements ClientInterface
      */
     public function __construct($parameters = null, $options = null)
     {
-        $this->options = $this->createOptions($options);
-        $this->profile = $this->options->profile;
+        $this->options    = $this->createOptions($options);
         $this->connection = $this->createConnection($parameters);
+        $this->profile    = $this->options->profile;
     }
 
     /**