From 7bdc2e6195bb00e975612caee847ee26610a0abd Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Fri, 25 Nov 2011 12:49:36 +0100 Subject: [PATCH] Rename a few protected/private field names. --- lib/Predis/Network/ConnectionBase.php | 12 ++++++------ lib/Predis/Network/PhpiredisConnection.php | 4 ++-- lib/Predis/Network/StreamConnection.php | 4 ++-- lib/Predis/Profiles/ServerProfile.php | 12 ++++++------ lib/Predis/Protocol/Text/TextResponseReader.php | 14 +++++++------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/Predis/Network/ConnectionBase.php b/lib/Predis/Network/ConnectionBase.php index 2af7933c..a175793d 100644 --- a/lib/Predis/Network/ConnectionBase.php +++ b/lib/Predis/Network/ConnectionBase.php @@ -29,7 +29,7 @@ abstract class ConnectionBase implements IConnectionSingle private $resource; private $cachedId; - protected $params; + protected $parameters; protected $initCmds; /** @@ -38,7 +38,7 @@ abstract class ConnectionBase implements IConnectionSingle public function __construct(IConnectionParameters $parameters) { $this->initCmds = array(); - $this->params = $this->checkParameters($parameters); + $this->parameters = $this->checkParameters($parameters); $this->initializeProtocol($parameters); } @@ -204,7 +204,7 @@ abstract class ConnectionBase implements IConnectionSingle */ public function getParameters() { - return $this->params; + return $this->parameters; } /** @@ -214,11 +214,11 @@ abstract class ConnectionBase implements IConnectionSingle */ protected function getIdentifier() { - if ($this->params->scheme === 'unix') { - return $this->params->path; + if ($this->parameters->scheme === 'unix') { + return $this->parameters->path; } - return "{$this->params->host}:{$this->params->port}"; + return "{$this->parameters->host}:{$this->parameters->port}"; } /** diff --git a/lib/Predis/Network/PhpiredisConnection.php b/lib/Predis/Network/PhpiredisConnection.php index 9058b131..6aa4d2cf 100644 --- a/lib/Predis/Network/PhpiredisConnection.php +++ b/lib/Predis/Network/PhpiredisConnection.php @@ -170,7 +170,7 @@ class PhpiredisConnection extends ConnectionBase */ protected function createResource() { - $parameters = $this->params; + $parameters = $this->parameters; $initializer = array($this, "{$parameters->scheme}SocketInitializer"); $socket = call_user_func($initializer, $parameters); @@ -325,7 +325,7 @@ class PhpiredisConnection extends ConnectionBase { parent::connect(); - $this->connectWithTimeout($this->params); + $this->connectWithTimeout($this->parameters); if (count($this->initCmds) > 0) { $this->sendInitializationCommands(); } diff --git a/lib/Predis/Network/StreamConnection.php b/lib/Predis/Network/StreamConnection.php index ab0bc9d1..8e803688 100644 --- a/lib/Predis/Network/StreamConnection.php +++ b/lib/Predis/Network/StreamConnection.php @@ -35,7 +35,7 @@ class StreamConnection extends ConnectionBase */ public function __destruct() { - if (!$this->params->connection_persistent) { + if (!$this->parameters->connection_persistent) { $this->disconnect(); } } @@ -54,7 +54,7 @@ class StreamConnection extends ConnectionBase */ protected function createResource() { - $parameters = $this->params; + $parameters = $this->parameters; $initializer = "{$parameters->scheme}StreamInitializer"; return $this->$initializer($parameters); diff --git a/lib/Predis/Profiles/ServerProfile.php b/lib/Predis/Profiles/ServerProfile.php index 8e9e8ab3..2ddd0399 100644 --- a/lib/Predis/Profiles/ServerProfile.php +++ b/lib/Predis/Profiles/ServerProfile.php @@ -24,7 +24,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport { private static $profiles; - private $registeredCommands; + private $commands; private $processor; /** @@ -32,7 +32,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport */ public function __construct() { - $this->registeredCommands = $this->getSupportedCommands(); + $this->commands = $this->getSupportedCommands(); } /** @@ -143,7 +143,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport */ public function supportsCommand($command) { - return isset($this->registeredCommands[strtolower($command)]); + return isset($this->commands[strtolower($command)]); } /** @@ -152,11 +152,11 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport public function createCommand($method, $arguments = array()) { $method = strtolower($method); - if (!isset($this->registeredCommands[$method])) { + if (!isset($this->commands[$method])) { throw new ClientException("'$method' is not a registered Redis command"); } - $commandClass = $this->registeredCommands[$method]; + $commandClass = $this->commands[$method]; $command = new $commandClass(); $command->setArguments($arguments); @@ -191,7 +191,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport if (!$commandReflection->isSubclassOf('\Predis\Commands\ICommand')) { throw new ClientException("Cannot register '$command' as it is not a valid Redis command"); } - $this->registeredCommands[strtolower($alias)] = $command; + $this->commands[strtolower($alias)] = $command; } /** diff --git a/lib/Predis/Protocol/Text/TextResponseReader.php b/lib/Predis/Protocol/Text/TextResponseReader.php index c43ef46a..764b2055 100644 --- a/lib/Predis/Protocol/Text/TextResponseReader.php +++ b/lib/Predis/Protocol/Text/TextResponseReader.php @@ -26,14 +26,14 @@ use Predis\Network\IConnectionComposable; */ class TextResponseReader implements IResponseReader { - private $prefixHandlers; + private $handlers; /** * */ public function __construct() { - $this->prefixHandlers = $this->getDefaultHandlers(); + $this->handlers = $this->getDefaultHandlers(); } /** @@ -60,7 +60,7 @@ class TextResponseReader implements IResponseReader */ public function setHandler($prefix, IResponseHandler $handler) { - $this->prefixHandlers[$prefix] = $handler; + $this->handlers[$prefix] = $handler; } /** @@ -72,8 +72,8 @@ class TextResponseReader implements IResponseReader */ public function getHandler($prefix) { - if (isset($this->prefixHandlers[$prefix])) { - return $this->prefixHandlers[$prefix]; + if (isset($this->handlers[$prefix])) { + return $this->handlers[$prefix]; } } @@ -88,11 +88,11 @@ class TextResponseReader implements IResponseReader } $prefix = $header[0]; - if (!isset($this->prefixHandlers[$prefix])) { + if (!isset($this->handlers[$prefix])) { $this->protocolError($connection, "Unknown prefix '$prefix'"); } - $handler = $this->prefixHandlers[$prefix]; + $handler = $this->handlers[$prefix]; return $handler->handle($connection, substr($header, 1)); }