Przeglądaj źródła

Rename the newConnection() method to create() in Predis\ConnectionFactory.

Daniele Alessandri 14 lat temu
rodzic
commit
83bab78bd1

+ 1 - 1
lib/Predis/Client.php

@@ -60,7 +60,7 @@ class Client {
     }
 
     private function createConnection($parameters) {
-        $connection = $this->_connectionFactory->newConnection($parameters);
+        $connection = $this->_connectionFactory->create($parameters);
         $this->pushInitCommands($connection);
         return $connection;
     }

+ 3 - 3
lib/Predis/ConnectionFactory.php

@@ -40,7 +40,7 @@ class ConnectionFactory implements IConnectionFactory {
         self::$_globalSchemes[$scheme] = $connectionClass;
     }
 
-    public function newConnection($parameters) {
+    public function create($parameters) {
         if (!$parameters instanceof IConnectionParameters) {
             $parameters = new ConnectionParameters($parameters);
         }
@@ -59,13 +59,13 @@ class ConnectionFactory implements IConnectionFactory {
         return new $connection($parameters);
     }
 
-    public function newConnectionByScheme($scheme, $parameters = array()) {
+    public function createByScheme($scheme, $parameters = array()) {
         if ($parameters instanceof IConnectionParameters) {
             $parameters = $parameters->toArray();
         }
         if (is_array($parameters)) {
             $parameters['scheme'] = $scheme;
-            return $this->newConnection($parameters);
+            return $this->create($parameters);
         }
         throw new \InvalidArgumentException("Invalid type for connection parameters");
     }

+ 1 - 1
lib/Predis/IConnectionFactory.php

@@ -3,5 +3,5 @@
 namespace Predis;
 
 interface IConnectionFactory {
-    public function newConnection($parameters);
+    public function create($parameters);
 }