Rename a few protected/private field names.

This commit is contained in:
Daniele Alessandri
2011-11-25 12:49:36 +01:00
parent 0fee0c6d97
commit 7bdc2e6195
5 changed files with 23 additions and 23 deletions
+6 -6
View File
@@ -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}";
}
/**
+2 -2
View File
@@ -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();
}
+2 -2
View File
@@ -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);
+6 -6
View File
@@ -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;
}
/**
@@ -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));
}