diff --git a/lib/Predis/Client.php b/lib/Predis/Client.php index afa6c81f..fa93d0a4 100644 --- a/lib/Predis/Client.php +++ b/lib/Predis/Client.php @@ -18,8 +18,6 @@ use Predis\Command\RawCommand; use Predis\Command\ScriptCommand; use Predis\Configuration; use Predis\Connection; -use Predis\Connection\AggregatedConnectionInterface; -use Predis\Connection\ConnectionInterface; use Predis\Monitor; use Predis\Pipeline; use Predis\PubSub; @@ -89,11 +87,11 @@ class Client implements ClientInterface * - Callable * * @param mixed $parameters Connection parameters or connection instance. - * @return ConnectionInterface + * @return Connection\ConnectionInterface */ protected function createConnection($parameters) { - if ($parameters instanceof ConnectionInterface) { + if ($parameters instanceof Connection\ConnectionInterface) { return $parameters; } @@ -146,7 +144,7 @@ class Client implements ClientInterface return function () use ($callable) { $connection = call_user_func_array($callable, func_get_args()); - if (!$connection instanceof ConnectionInterface) { + if (!$connection instanceof Connection\ConnectionInterface) { throw new UnexpectedValueException( 'The callable connection initializer returned an invalid type' ); @@ -242,9 +240,9 @@ class Client implements ClientInterface */ public function getConnectionById($connectionID) { - if (!$this->connection instanceof AggregatedConnectionInterface) { + if (!$this->connection instanceof Connection\AggregateConnectionInterface) { throw new NotSupportedException( - 'Retrieving connections by ID is supported only when using aggregated connections' + 'Retrieving connections by ID is supported only when using aggregate connections' ); } diff --git a/lib/Predis/Connection/AggregatedConnectionInterface.php b/lib/Predis/Connection/AggregateConnectionInterface.php similarity index 95% rename from lib/Predis/Connection/AggregatedConnectionInterface.php rename to lib/Predis/Connection/AggregateConnectionInterface.php index 66db49e0..87c35c8e 100644 --- a/lib/Predis/Connection/AggregatedConnectionInterface.php +++ b/lib/Predis/Connection/AggregateConnectionInterface.php @@ -19,7 +19,7 @@ use Predis\Command\CommandInterface; * * @author Daniele Alessandri */ -interface AggregatedConnectionInterface extends ConnectionInterface +interface AggregateConnectionInterface extends ConnectionInterface { /** * Adds a connection instance to the aggregate connection. diff --git a/lib/Predis/Connection/ClusterConnectionInterface.php b/lib/Predis/Connection/ClusterConnectionInterface.php index 582b8aa2..4140ad33 100644 --- a/lib/Predis/Connection/ClusterConnectionInterface.php +++ b/lib/Predis/Connection/ClusterConnectionInterface.php @@ -17,6 +17,6 @@ namespace Predis\Connection; * * @author Daniele Alessandri */ -interface ClusterConnectionInterface extends AggregatedConnectionInterface +interface ClusterConnectionInterface extends AggregateConnectionInterface { } diff --git a/lib/Predis/Connection/Factory.php b/lib/Predis/Connection/Factory.php index 57f3e7a1..61b5499c 100644 --- a/lib/Predis/Connection/Factory.php +++ b/lib/Predis/Connection/Factory.php @@ -106,7 +106,7 @@ class Factory implements FactoryInterface /** * {@inheritdoc} */ - public function aggregate(AggregatedConnectionInterface $connection, array $parameters) + public function aggregate(AggregateConnectionInterface $connection, array $parameters) { foreach ($parameters as $node) { $connection->add($node instanceof SingleConnectionInterface ? $node : $this->create($node)); diff --git a/lib/Predis/Connection/FactoryInterface.php b/lib/Predis/Connection/FactoryInterface.php index 06f6de82..787f3a35 100644 --- a/lib/Predis/Connection/FactoryInterface.php +++ b/lib/Predis/Connection/FactoryInterface.php @@ -44,8 +44,8 @@ interface FactoryInterface /** * Aggregates single connections into an aggregate connection instance. * - * @param AggregatedConnectionInterface $aggregate Aggregate connection instance. + * @param AggregateConnectionInterface $aggregate Aggregate connection instance. * @param array $parameters List of parameters for each connection. */ - public function aggregate(AggregatedConnectionInterface $aggregate, array $parameters); + public function aggregate(AggregateConnectionInterface $aggregate, array $parameters); } diff --git a/lib/Predis/Connection/PredisCluster.php b/lib/Predis/Connection/PredisCluster.php index fbd9124c..f09f3947 100644 --- a/lib/Predis/Connection/PredisCluster.php +++ b/lib/Predis/Connection/PredisCluster.php @@ -19,7 +19,7 @@ use Predis\Cluster\Distributor; use Predis\Command\CommandInterface; /** - * Abstraction for a cluster of aggregated connections to various Redis servers + * Abstraction for a cluster of aggregate connections to various Redis servers * implementing client-side sharding based on pluggable distribution strategies. * * @author Daniele Alessandri diff --git a/lib/Predis/Connection/ReplicationConnectionInterface.php b/lib/Predis/Connection/ReplicationConnectionInterface.php index 13755c9c..32747897 100644 --- a/lib/Predis/Connection/ReplicationConnectionInterface.php +++ b/lib/Predis/Connection/ReplicationConnectionInterface.php @@ -16,7 +16,7 @@ namespace Predis\Connection; * * @author Daniele Alessandri */ -interface ReplicationConnectionInterface extends AggregatedConnectionInterface +interface ReplicationConnectionInterface extends AggregateConnectionInterface { /** * Switches the internal connection instance in use. diff --git a/lib/Predis/Monitor/Consumer.php b/lib/Predis/Monitor/Consumer.php index cfce9301..bc7ca99d 100644 --- a/lib/Predis/Monitor/Consumer.php +++ b/lib/Predis/Monitor/Consumer.php @@ -14,7 +14,7 @@ namespace Predis\Monitor; use Iterator; use Predis\ClientInterface; use Predis\NotSupportedException; -use Predis\Connection\AggregatedConnectionInterface; +use Predis\Connection\AggregateConnectionInterface; /** * Redis MONITOR consumer. @@ -54,9 +54,9 @@ class Consumer implements Iterator */ private function assertClient(ClientInterface $client) { - if ($client->getConnection() instanceof AggregatedConnectionInterface) { + if ($client->getConnection() instanceof AggregateConnectionInterface) { throw new NotSupportedException( - 'Cannot initialize a monitor consumer when using aggregated connections' + 'Cannot initialize a monitor consumer when using aggregate connections' ); } diff --git a/lib/Predis/PubSub/Consumer.php b/lib/Predis/PubSub/Consumer.php index 99fb2712..0593f9b5 100644 --- a/lib/Predis/PubSub/Consumer.php +++ b/lib/Predis/PubSub/Consumer.php @@ -15,7 +15,7 @@ use Predis\ClientException; use Predis\ClientInterface; use Predis\Command\Command; use Predis\NotSupportedException; -use Predis\Connection\AggregatedConnectionInterface; +use Predis\Connection\AggregateConnectionInterface; /** * PUB/SUB consumer abstraction. @@ -59,9 +59,9 @@ class Consumer extends AbstractConsumer */ private function checkCapabilities(ClientInterface $client) { - if ($client->getConnection() instanceof AggregatedConnectionInterface) { + if ($client->getConnection() instanceof AggregateConnectionInterface) { throw new NotSupportedException( - 'Cannot initialize a PUB/SUB consumer when using aggregated connections' + 'Cannot initialize a PUB/SUB consumer when using aggregate connections' ); } diff --git a/lib/Predis/Transaction/MultiExec.php b/lib/Predis/Transaction/MultiExec.php index 274a30cf..de1f1f7f 100644 --- a/lib/Predis/Transaction/MultiExec.php +++ b/lib/Predis/Transaction/MultiExec.php @@ -21,7 +21,7 @@ use Predis\ExecutableContextInterface; use Predis\NotSupportedException; use Predis\Response; use Predis\Command\CommandInterface; -use Predis\Connection\AggregatedConnectionInterface; +use Predis\Connection\AggregateConnectionInterface; use Predis\Protocol\ProtocolException; /** @@ -63,9 +63,9 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface */ private function preconditions(ClientInterface $client) { - if ($client->getConnection() instanceof AggregatedConnectionInterface) { + if ($client->getConnection() instanceof AggregateConnectionInterface) { throw new NotSupportedException( - 'Cannot initialize a MULTI/EXEC transaction when using aggregated connections' + 'Cannot initialize a MULTI/EXEC transaction when using aggregate connections' ); } @@ -419,7 +419,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface */ private function onProtocolError($message) { - // Since a MULTI/EXEC block cannot be initialized when using aggregated + // Since a MULTI/EXEC block cannot be initialized when using aggregate // connections we can safely assume that Predis\Client::getConnection() // will return a Predis\Connection\SingleConnectionInterface instance. CommunicationException::handle(new ProtocolException( diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index 9eb070e5..265e055d 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -579,7 +579,7 @@ class ClientTest extends PredisTestCase /** * @group disconnected */ - public function testGetConnectionFromAggregatedConnectionWithAlias() + public function testGetConnectionFromAggregateConnectionWithAlias() { $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02')); @@ -594,9 +594,9 @@ class ClientTest extends PredisTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage Retrieving connections by ID is supported only when using aggregated connections + * @expectedExceptionMessage Retrieving connections by ID is supported only when using aggregate connections */ - public function testGetConnectionByIdWorksOnlyWithAggregatedConnections() + public function testGetConnectionByIdWorksOnlyWithAggregateConnections() { $client = new Client(); @@ -606,7 +606,7 @@ class ClientTest extends PredisTestCase /** * @group disconnected */ - public function testCreateClientWithConnectionFromAggregatedConnection() + public function testCreateClientWithConnectionFromAggregateConnection() { $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02'), array('prefix' => 'pfx:')); diff --git a/tests/Predis/Connection/FactoryTest.php b/tests/Predis/Connection/FactoryTest.php index 282babd3..fdf9dd95 100644 --- a/tests/Predis/Connection/FactoryTest.php +++ b/tests/Predis/Connection/FactoryTest.php @@ -265,7 +265,7 @@ class FactoryTest extends PredisTestCase /** * @group disconnected */ - public function testAggregatedConnectionSkipCreationOnConnectionInstance() + public function testAggregateConnectionSkipCreationOnConnectionInstance() { list(, $connectionClass) = $this->getMockConnectionClass(); @@ -284,7 +284,7 @@ class FactoryTest extends PredisTestCase /** * @group disconnected */ - public function testAggregatedConnectionWithMixedParameters() + public function testAggregateConnectionWithMixedParameters() { list(, $connectionClass) = $this->getMockConnectionClass(); @@ -306,7 +306,7 @@ class FactoryTest extends PredisTestCase /** * @group disconnected */ - public function testAggregatedConnectionWithEmptyListOfParameters() + public function testAggregateConnectionWithEmptyListOfParameters() { $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $cluster->expects($this->never())->method('add'); diff --git a/tests/Predis/Monitor/ConsumerTest.php b/tests/Predis/Monitor/ConsumerTest.php index 95e1053b..372f4836 100644 --- a/tests/Predis/Monitor/ConsumerTest.php +++ b/tests/Predis/Monitor/ConsumerTest.php @@ -41,7 +41,7 @@ class ConsumerTest extends PredisTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage Cannot initialize a monitor consumer when using aggregated connections + * @expectedExceptionMessage Cannot initialize a monitor consumer when using aggregate connections */ public function testMonitorConsumerDoesNotWorkOnClusters() { diff --git a/tests/Predis/Pipeline/AtomicTest.php b/tests/Predis/Pipeline/AtomicTest.php index e1e74660..bf135c0b 100644 --- a/tests/Predis/Pipeline/AtomicTest.php +++ b/tests/Predis/Pipeline/AtomicTest.php @@ -152,7 +152,7 @@ class AtomicTest extends PredisTestCase * @expectedException Predis\ClientException * @expectedExceptionMessage Predis\Pipeline\Atomic can be used only with connections to single nodes */ - public function testExecutorWithAggregatedConnection() + public function testExecutorWithAggregateConnection() { $connection = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $pipeline = new Atomic(new Client($connection)); diff --git a/tests/Predis/PubSub/ConsumerTest.php b/tests/Predis/PubSub/ConsumerTest.php index 37dcf344..cd6afb4a 100644 --- a/tests/Predis/PubSub/ConsumerTest.php +++ b/tests/Predis/PubSub/ConsumerTest.php @@ -40,7 +40,7 @@ class ConsumerTest extends PredisTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage Cannot initialize a PUB/SUB consumer when using aggregated connections + * @expectedExceptionMessage Cannot initialize a PUB/SUB consumer when using aggregate connections */ public function testPubSubConsumerDoesNotWorkOnClusters() {