Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move some classes and interfaces in other namespaces.

  • Loading branch information...
commit 559853bdd5a7c7c40b657d0ab5147100f046f8dc 1 parent 28e1e7a
@nrk authored
Showing with 40 additions and 51 deletions.
  1. +5 −3 CHANGELOG.NAMING.md
  2. +0 −1  examples/SimpleDebuggableConnection.php
  3. +2 −0  lib/Predis/Client.php
  4. +0 −1  lib/Predis/Connection/AbstractConnection.php
  5. +0 −1  lib/Predis/Connection/ComposableStreamConnection.php
  6. +1 −3 lib/Predis/{ → Connection}/ConnectionFactory.php
  7. +1 −2  lib/Predis/{ → Connection}/ConnectionFactoryInterface.php
  8. +1 −1  lib/Predis/{ → Connection}/ConnectionParameters.php
  9. +1 −1  lib/Predis/{ → Connection}/ConnectionParametersInterface.php
  10. +0 −1  lib/Predis/Connection/PhpiredisConnection.php
  11. +2 −3 lib/Predis/Connection/RedisCluster.php
  12. +0 −1  lib/Predis/Connection/StreamConnection.php
  13. +0 −1  lib/Predis/Connection/WebdisConnection.php
  14. +3 −3 lib/Predis/Option/ClientConnectionFactory.php
  15. +0 −1  tests/PHPUnit/ConnectionTestCase.php
  16. +2 −1  tests/Predis/ClientTest.php
  17. +7 −7 tests/Predis/{ → Connection}/ConnectionFactoryTest.php
  18. +2 −2 tests/Predis/{ → Connection}/ConnectionParametersTest.php
  19. +0 −1  tests/Predis/Connection/MasterSlaveReplicationTest.php
  20. +1 −2  tests/Predis/Connection/PhpiredisConnectionTest.php
  21. +0 −1  tests/Predis/Connection/PredisClusterTest.php
  22. +1 −2  tests/Predis/Connection/StreamConnectionTest.php
  23. +0 −1  tests/Predis/Connection/WebdisConnectionTest.php
  24. +8 −8 tests/Predis/Option/ClientConnectionFactoryTest.php
  25. +3 −3 tests/Predis/Option/ClientOptionsTest.php
View
8 CHANGELOG.NAMING.md
@@ -17,8 +17,6 @@ by the naming conventions adopted by the Symfony2 project. This is a list of all
- `Predis\IReplyObject` => `Predis\ResponseObjectInterface`
- `Predis\IRedisServerError` => `Predis\ResponseErrorInterface`
- - `Predis\IConnectionFactory` => `Predis\ConnectionFactoryInterface`
- - `Predis\IConnectionParameters` => `Predis\ConnectionParametersInterface`
- `Predis\Options\IOption` => `Predis\Option\OptionInterface`
- `Predis\Options\IClientOptions` => `Predis\Option\ClientOptionsInterface`
- `Predis\Profile\IServerProfile` => `Predis\Profile\ServerProfileInterface`
@@ -48,4 +46,8 @@ by the naming conventions adopted by the Symfony2 project. This is a list of all
### Classes or interfaces moved to different namespaces ###
- - `Predis\MonitorContext` is now under the `Predis\Monitor`.
+ - `Predis\MonitorContext` => `Predis\Monitor\MonitorContext`
+ - `Predis\ConnectionParameters` => `Predis\Connection\ConnectionParameters`
+ - `Predis\ConnectionParametersInterface` => `Predis\Connection\ConnectionParametersInterface`
+ - `Predis\ConnectionFactory` => `Predis\Connection\ConnectionFactory`
+ - `Predis\ConnectionFactoryInterface` => `Predis\Connection\ConnectionFactoryInterface`
View
1  examples/SimpleDebuggableConnection.php
@@ -11,7 +11,6 @@
require 'SharedConfigurations.php';
-use Predis\ConnectionParameters;
use Predis\Command\CommandInterface;
use Predis\Connection\StreamConnection;
View
2  lib/Predis/Client.php
@@ -15,6 +15,8 @@
use Predis\Option\ClientOptionsInterface;
use Predis\Connection\ConnectionInterface;
use Predis\Connection\AggregatedConnectionInterface;
+use Predis\Connection\ConnectionFactory;
+use Predis\Connection\ConnectionFactoryInterface;
use Predis\Profile\ServerProfileInterface;
use Predis\Option\ClientOptions;
use Predis\Profile\ServerProfile;
View
1  lib/Predis/Connection/AbstractConnection.php
@@ -13,7 +13,6 @@
use Predis\Helpers;
use Predis\ResponseObjectInterface;
-use Predis\ConnectionParametersInterface;
use Predis\ClientException;
use Predis\NotSupportedException;
use Predis\Command\CommandInterface;
View
1  lib/Predis/Connection/ComposableStreamConnection.php
@@ -11,7 +11,6 @@
namespace Predis\Connection;
-use Predis\ConnectionParametersInterface;
use Predis\Command\CommandInterface;
use Predis\Protocol\ProtocolInterface;
use Predis\Protocol\Text\TextProtocol;
View
4 lib/Predis/ConnectionFactory.php → lib/Predis/Connection/ConnectionFactory.php
@@ -9,11 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Predis;
+namespace Predis\Connection;
use Predis\Profile\ServerProfileInterface;
-use Predis\Connection\SingleConnectionInterface;
-use Predis\Connection\AggregatedConnectionInterface;
use Predis\Profile\ServerProfile;
/**
View
3  lib/Predis/ConnectionFactoryInterface.php → lib/Predis/Connection/ConnectionFactoryInterface.php
@@ -9,10 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Predis;
+namespace Predis\Connection;
use Predis\Profile\ServerProfileInterface;
-use Predis\Connection\AggregatedConnectionInterface;
/**
* Interface that must be implemented by classes that provide their own mechanism
View
2  lib/Predis/ConnectionParameters.php → lib/Predis/Connection/ConnectionParameters.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Predis;
+namespace Predis\Connection;
use Predis\Option\OptionInterface;
View
2  lib/Predis/ConnectionParametersInterface.php → ...edis/Connection/ConnectionParametersInterface.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Predis;
+namespace Predis\Connection;
/**
* Interface that must be implemented by classes that provide their own mechanism
View
1  lib/Predis/Connection/PhpiredisConnection.php
@@ -12,7 +12,6 @@
namespace Predis\Connection;
use Predis\Command\CommandInterface;
-use Predis\ConnectionParametersInterface;
use Predis\ResponseError;
use Predis\ResponseQueued;
use Predis\ClientException;
View
5 lib/Predis/Connection/RedisCluster.php
@@ -12,7 +12,6 @@
namespace Predis\Connection;
use Predis\ResponseErrorInterface;
-use Predis\ConnectionFactoryInterface;
use Predis\Command\CommandInterface;
use Predis\ClientException;
use Predis\NotSupportedException;
@@ -31,9 +30,9 @@ class RedisCluster implements ClusterConnectionInterface, \IteratorAggregate, \C
private $hashgenerator;
/**
- * @param ConnectionFactoryInterface $connections Connection factory object.
+ * @param FactoryInterface $connections Connection factory object.
*/
- public function __construct(ConnectionFactoryInterface $connections = null)
+ public function __construct(FactoryInterface $connections = null)
{
$this->pool = array();
$this->slots = array();
View
1  lib/Predis/Connection/StreamConnection.php
@@ -14,7 +14,6 @@
use Predis\ResponseError;
use Predis\ResponseQueued;
use Predis\NotSupportedException;
-use Predis\ConnectionParametersInterface;
use Predis\Command\CommandInterface;
use Predis\Iterator\MultiBulkResponseSimple;
View
1  lib/Predis/Connection/WebdisConnection.php
@@ -13,7 +13,6 @@
use Predis\Command\CommandInterface;
use Predis\ResponseObjectInterface;
-use Predis\ConnectionParametersInterface;
use Predis\ResponseError;
use Predis\NotSupportedException;
use Predis\Protocol\ProtocolException;
View
6 lib/Predis/Option/ClientConnectionFactory.php
@@ -11,8 +11,8 @@
namespace Predis\Option;
-use Predis\ConnectionFactoryInterface;
-use Predis\ConnectionFactory;
+use Predis\Connection\ConnectionFactory;
+use Predis\Connection\ConnectionFactoryInterface;
/**
* Option class that returns a connection factory to be used by a client.
@@ -38,7 +38,7 @@ public function filter(ClientOptionsInterface $options, $value)
}
if (is_string($value) && class_exists($value)) {
if (!($factory = new $value()) && !$factory instanceof ConnectionFactoryInterface) {
- throw new \InvalidArgumentException("Class $value must be an instance of Predis\ConnectionFactoryInterface");
+ throw new \InvalidArgumentException("Class $value must be an instance of Predis\Connection\ConnectionFactoryInterface");
}
return $factory;
}
View
1  tests/PHPUnit/ConnectionTestCase.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
View
3  tests/Predis/ClientTest.php
@@ -16,6 +16,7 @@
use Predis\Profile\ServerProfile;
use Predis\Connection\PredisCluster;
use Predis\Connection\MasterSlaveReplication;
+use Predis\Connection\ConnectionFactory;
/**
*
@@ -201,7 +202,7 @@ public function testConstructorWithReplicationArgument()
*/
public function testConstructorWithNullAndArrayArgument()
{
- $factory = $this->getMock('Predis\ConnectionFactoryInterface');
+ $factory = $this->getMock('Predis\Connection\ConnectionFactoryInterface');
$arg2 = array('profile' => '2.0', 'prefix' => 'prefix:', 'connections' => $factory);
$client = new Client(null, $arg2);
View
14 tests/Predis/ConnectionFactoryTest.php → tests/Predis/Connection/ConnectionFactoryTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Predis;
+namespace Predis\Connection;
use \PHPUnit_Framework_TestCase as StandardTestCase;
@@ -25,7 +25,7 @@ public function testImplementsCorrectInterface()
{
$factory = new ConnectionFactory();
- $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $factory);
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $factory);
}
/**
@@ -275,7 +275,7 @@ public function testAggregatedConnectionSkipCreationOnConnectionInstance()
->method('add')
->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface'));
- $factory = $this->getMock('Predis\ConnectionFactory', array('create'));
+ $factory = $this->getMock('Predis\Connection\ConnectionFactory', array('create'));
$factory->expects($this->never())
->method('create');
@@ -285,7 +285,7 @@ public function testAggregatedConnectionSkipCreationOnConnectionInstance()
/**
* @group disconnected
*/
- public function testAggregatedConnectionWithMixedConnectionParameters()
+ public function testAggregatedConnectionWithMixedParameters()
{
list(, $connectionClass) = $this->getMockConnectionClass();
@@ -294,7 +294,7 @@ public function testAggregatedConnectionWithMixedConnectionParameters()
->method('add')
->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface'));
- $factory = $this->getMock('Predis\ConnectionFactory', array('create'));
+ $factory = $this->getMock('Predis\Connection\ConnectionFactory', array('create'));
$factory->expects($this->exactly(3))
->method('create')
->will($this->returnCallback(function($_, $_) use($connectionClass) {
@@ -312,7 +312,7 @@ public function testAggregatedConnectionWithEmptyListOfParameters()
$cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
$cluster->expects($this->never())->method('add');
- $factory = $this->getMock('Predis\ConnectionFactory', array('create'));
+ $factory = $this->getMock('Predis\Connection\ConnectionFactory', array('create'));
$factory->expects($this->never())->method('create');
$factory->createAggregated($cluster, array());
@@ -329,7 +329,7 @@ public function testAggregatedConnectionWithServerProfileArgument()
$cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
$profile = $this->getMock('Predis\Profile\ServerProfileInterface');
- $factory = $this->getMock('Predis\ConnectionFactory', array('create'));
+ $factory = $this->getMock('Predis\Connection\ConnectionFactory', array('create'));
$factory->expects($this->exactly(2))
->method('create')
->with($this->anything(), $profile)
View
4 tests/Predis/ConnectionParametersTest.php → tests/Predis/Connection/ConnectionParametersTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Predis;
+namespace Predis\Connection;
use \PHPUnit_Framework_TestCase as StandardTestCase;
@@ -17,7 +17,7 @@
* @todo ConnectionParameters::define();
* @todo ConnectionParameters::undefine();
*/
-class ConnectionParametersTest extends StandardTestCase
+class ParametersTest extends StandardTestCase
{
/**
* @group disconnected
View
1  tests/Predis/Connection/MasterSlaveReplicationTest.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
View
3  tests/Predis/Connection/PhpiredisConnectionTest.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
@@ -34,7 +33,7 @@ public function testConstructorDoesNotOpenConnection()
/**
* @group disconnected
*/
- public function testExposesConnectionParameters()
+ public function testExposesParameters()
{
$parameters = $this->getParameters();
$connection = new PhpiredisConnection($parameters);
View
1  tests/Predis/Connection/PredisClusterTest.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
View
3  tests/Predis/Connection/StreamConnectionTest.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
@@ -34,7 +33,7 @@ public function testConstructorDoesNotOpenConnection()
/**
* @group disconnected
*/
- public function testExposesConnectionParameters()
+ public function testExposesParameters()
{
$parameters = $this->getParameters();
$connection = new StreamConnection($parameters);
View
1  tests/Predis/Connection/WebdisConnectionTest.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
View
16 tests/Predis/Option/ClientConnectionFactoryTest.php
@@ -13,7 +13,7 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionFactory;
+use Predis\Connection\ConnectionFactory;
/**
*
@@ -30,7 +30,7 @@ public function testValidationReturnsDefaultFactoryWithSchemeDefinitionsArray()
$options = $this->getMock('Predis\Option\ClientOptionsInterface');
- $default = $this->getMock('Predis\ConnectionFactoryInterface');
+ $default = $this->getMock('Predis\Connection\ConnectionFactoryInterface');
$default->expects($this->exactly(2))
->method('define')
->with($this->matchesRegularExpression('/^tcp|redis$/'), $connectionClass);
@@ -43,7 +43,7 @@ public function testValidationReturnsDefaultFactoryWithSchemeDefinitionsArray()
$factory = $option->filter($options, $value);
- $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $factory);
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $factory);
$this->assertSame($default, $factory);
}
@@ -52,7 +52,7 @@ public function testValidationReturnsDefaultFactoryWithSchemeDefinitionsArray()
*/
public function testValidationAcceptsFactoryInstancesAsValue()
{
- $value = $this->getMock('Predis\ConnectionFactoryInterface');
+ $value = $this->getMock('Predis\Connection\ConnectionFactoryInterface');
$options = $this->getMock('Predis\Option\ClientOptionsInterface');
$option = $this->getMock('Predis\Option\ClientConnectionFactory', array('getDefault'));
@@ -66,7 +66,7 @@ public function testValidationAcceptsFactoryInstancesAsValue()
*/
public function testValidationAcceptsStringAsValue()
{
- $factory = 'Predis\ConnectionFactory';
+ $factory = 'Predis\Connection\ConnectionFactory';
$options = $this->getMock('Predis\Option\ClientOptionsInterface');
$option = $this->getMock('Predis\Option\ClientConnectionFactory', array('getDefault'));
@@ -93,7 +93,7 @@ public function testValidationThrowsExceptionOnWrongInvalidArguments()
*/
public function testInvokeReturnsSpecifiedFactoryOrDefault()
{
- $value = $this->getMock('Predis\ConnectionFactoryInterface');
+ $value = $this->getMock('Predis\Connection\ConnectionFactoryInterface');
$options = $this->getMock('Predis\Option\ClientOptionsInterface');
$option = $this->getMock('Predis\Option\ClientConnectionFactory', array('filter', 'getDefault'));
@@ -103,7 +103,7 @@ public function testInvokeReturnsSpecifiedFactoryOrDefault()
->will($this->returnValue($value));
$option->expects($this->never())->method('getDefault');
- $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $option($options, $value));
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $option($options, $value));
$option = $this->getMock('Predis\Option\ClientConnectionFactory', array('filter', 'getDefault'));
$option->expects($this->never())->method('filter');
@@ -112,6 +112,6 @@ public function testInvokeReturnsSpecifiedFactoryOrDefault()
->with($options)
->will($this->returnValue($value));
- $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $option($options, null));
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $option($options, null));
}
}
View
6 tests/Predis/Option/ClientOptionsTest.php
@@ -26,7 +26,7 @@ public function testConstructorWithoutArguments()
{
$options = new ClientOptions();
- $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $options->connections);
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $options->connections);
$this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $options->profile);
$this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $options->cluster);
$this->assertNull($options->prefix);
@@ -39,13 +39,13 @@ public function testConstructorWithArrayArgument()
{
$options = new ClientOptions(array(
'cluster' => 'Predis\Connection\PredisCluster',
- 'connections' => 'Predis\ConnectionFactory',
+ 'connections' => 'Predis\Connection\ConnectionFactory',
'prefix' => 'prefix:',
'profile' => '2.0',
'exceptions' => false,
));
- $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $options->connections);
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $options->connections);
$this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $options->profile);
$this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $options->cluster);
$this->assertInstanceOf('Predis\Command\Processor\CommandProcessorInterface', $options->prefix);
Please sign in to comment.
Something went wrong with that request. Please try again.