mirror of
https://github.com/predis/predis.git
synced 2026-08-31 04:35:05 +00:00
Rename the newConnection() method to create() in Predis\ConnectionFactory.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
namespace Predis;
|
||||
|
||||
interface IConnectionFactory {
|
||||
public function newConnection($parameters);
|
||||
public function create($parameters);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user