Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: nrk/predis
base: 28e1e7ad25
...
head fork: nrk/predis
compare: 6c732c737b
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 55 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 26, 2012
@nrk Move some classes and interfaces in other namespaces. 559853b
@nrk Order "use" directives by namespace depth and name.
This is not really useful per se, but at least we use a fixed rule.
6c732c7
Showing with 111 additions and 120 deletions.
  1. +5 −3 CHANGELOG.NAMING.md
  2. +1 −1  examples/CustomDistributionStrategy.php
  3. +1 −1  examples/MasterSlaveReplicationComplex.php
  4. +0 −1  examples/SimpleDebuggableConnection.php
  5. +8 −6 lib/Predis/Client.php
  6. +1 −1  lib/Predis/ClientInterface.php
  7. +0 −1  lib/Predis/Command/AbstractCommand.php
  8. +2 −3 lib/Predis/Connection/AbstractConnection.php
  9. +0 −1  lib/Predis/Connection/ComposableStreamConnection.php
  10. +2 −4 lib/Predis/{ → Connection}/ConnectionFactory.php
  11. +1 −2  lib/Predis/{ → Connection}/ConnectionFactoryInterface.php
  12. +1 −1  lib/Predis/{ → Connection}/ConnectionParameters.php
  13. +1 −1  lib/Predis/{ → Connection}/ConnectionParametersInterface.php
  14. +1 −1  lib/Predis/Connection/MasterSlaveReplication.php
  15. +3 −4 lib/Predis/Connection/PhpiredisConnection.php
  16. +3 −3 lib/Predis/Connection/PredisCluster.php
  17. +4 −5 lib/Predis/Connection/RedisCluster.php
  18. +1 −2  lib/Predis/Connection/StreamConnection.php
  19. +4 −5 lib/Predis/Connection/WebdisConnection.php
  20. +2 −2 lib/Predis/Helpers.php
  21. +1 −1  lib/Predis/Option/ClientCluster.php
  22. +3 −3 lib/Predis/Option/ClientConnectionFactory.php
  23. +1 −1  lib/Predis/Option/ClientReplication.php
  24. +4 −4 lib/Predis/Pipeline/MultiExecExecutor.php
  25. +3 −3 lib/Predis/Pipeline/PipelineContext.php
  26. +1 −1  lib/Predis/Pipeline/SafeExecutor.php
  27. +1 −1  lib/Predis/Pipeline/StandardExecutor.php
  28. +1 −1  lib/Predis/Profile/ServerProfile.php
  29. +1 −1  lib/Predis/Protocol/Text/ComposableTextProtocol.php
  30. +2 −2 lib/Predis/Protocol/Text/ResponseBulkHandler.php
  31. +1 −1  lib/Predis/Protocol/Text/ResponseErrorHandler.php
  32. +2 −2 lib/Predis/Protocol/Text/ResponseIntegerHandler.php
  33. +2 −2 lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php
  34. +2 −2 lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php
  35. +1 −1  lib/Predis/Protocol/Text/ResponseStatusHandler.php
  36. +2 −2 lib/Predis/Protocol/Text/TextProtocol.php
  37. +3 −3 lib/Predis/Protocol/Text/TextResponseReader.php
  38. +1 −1  lib/Predis/PubSub/AbstractPubSubContext.php
  39. +1 −1  lib/Predis/PubSub/PubSubContext.php
  40. +6 −6 lib/Predis/Transaction/MultiExecContext.php
  41. +0 −1  tests/PHPUnit/ConnectionTestCase.php
  42. +4 −3 tests/Predis/ClientTest.php
  43. +2 −1  tests/Predis/Command/Hash/CommandHashStrategyTest.php
  44. +1 −0  tests/Predis/CommunicationExceptionTest.php
  45. +7 −7 tests/Predis/{ → Connection}/ConnectionFactoryTest.php
  46. +2 −2 tests/Predis/{ → Connection}/ConnectionParametersTest.php
  47. +0 −1  tests/Predis/Connection/MasterSlaveReplicationTest.php
  48. +1 −2  tests/Predis/Connection/PhpiredisConnectionTest.php
  49. +0 −1  tests/Predis/Connection/PredisClusterTest.php
  50. +1 −2  tests/Predis/Connection/StreamConnectionTest.php
  51. +0 −1  tests/Predis/Connection/WebdisConnectionTest.php
  52. +8 −8 tests/Predis/Option/ClientConnectionFactoryTest.php
  53. +3 −3 tests/Predis/Option/ClientOptionsTest.php
  54. +1 −1  tests/Predis/Option/ClientProfileTest.php
  55. +1 −0  tests/Predis/Profile/ServerProfileTest.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
2  examples/CustomDistributionStrategy.php
@@ -15,8 +15,8 @@
// to distribute keys among a cluster of servers simply by creating a class
// that implements Predis\Distribution\DistributionStrategyInterface.
-use Predis\Distribution\DistributionStrategyInterface;
use Predis\Connection\PredisCluster;
+use Predis\Distribution\DistributionStrategyInterface;
class NaiveDistributionStrategy implements DistributionStrategyInterface
{
View
2  examples/MasterSlaveReplicationComplex.php
@@ -18,9 +18,9 @@
// in the server profile used by the new client instance and marks it marks it as
// a read-only operation for replication so that it will be executed on slaves.
-use Predis\Profile\ServerProfile;
use Predis\Command\ScriptedCommand;
use Predis\Connection\MasterSlaveReplication;
+use Predis\Profile\ServerProfile;
// ------------------------------------------------------------------------- //
View
1  examples/SimpleDebuggableConnection.php
@@ -11,7 +11,6 @@
require 'SharedConfigurations.php';
-use Predis\ConnectionParameters;
use Predis\Command\CommandInterface;
use Predis\Connection\StreamConnection;
View
14 lib/Predis/Client.php
@@ -12,17 +12,19 @@
namespace Predis;
use Predis\Command\CommandInterface;
-use Predis\Option\ClientOptionsInterface;
-use Predis\Connection\ConnectionInterface;
+use Predis\Command\ScriptedCommand;
use Predis\Connection\AggregatedConnectionInterface;
-use Predis\Profile\ServerProfileInterface;
+use Predis\Connection\ConnectionInterface;
+use Predis\Connection\ConnectionFactory;
+use Predis\Connection\ConnectionFactoryInterface;
+use Predis\Monitor\MonitorContext;
use Predis\Option\ClientOptions;
+use Predis\Option\ClientOptionsInterface;
+use Predis\Pipeline\PipelineContext;
use Predis\Profile\ServerProfile;
+use Predis\Profile\ServerProfileInterface;
use Predis\PubSub\PubSubContext;
-use Predis\Monitor\MonitorContext;
-use Predis\Pipeline\PipelineContext;
use Predis\Transaction\MultiExecContext;
-use Predis\Command\ScriptedCommand;
/**
* Main class that exposes the most high-level interface to interact with Redis.
View
2  lib/Predis/ClientInterface.php
@@ -11,8 +11,8 @@
namespace Predis;
-use Predis\Option\ClientOptionsInterface;
use Predis\Connection\ConnectionInterface;
+use Predis\Option\ClientOptionsInterface;
use Predis\Profile\ServerProfileInterface;
/**
View
1  lib/Predis/Command/AbstractCommand.php
@@ -11,7 +11,6 @@
namespace Predis\Command;
-
/**
* Base class for Redis commands.
*
View
5 lib/Predis/Connection/AbstractConnection.php
@@ -11,11 +11,10 @@
namespace Predis\Connection;
-use Predis\Helpers;
-use Predis\ResponseObjectInterface;
-use Predis\ConnectionParametersInterface;
use Predis\ClientException;
+use Predis\Helpers;
use Predis\NotSupportedException;
+use Predis\ResponseObjectInterface;
use Predis\Command\CommandInterface;
use Predis\Protocol\ProtocolException;
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
6 lib/Predis/ConnectionFactory.php → lib/Predis/Connection/ConnectionFactory.php
@@ -9,12 +9,10 @@
* 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;
+use Predis\Profile\ServerProfileInterface;
/**
* Provides a default factory for Redis connections that maps URI schemes
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
2  lib/Predis/Connection/MasterSlaveReplication.php
@@ -11,8 +11,8 @@
namespace Predis\Connection;
-use Predis\Command\CommandInterface;
use Predis\NotSupportedException;
+use Predis\Command\CommandInterface;
/**
* Defines the standard virtual connection class that is used
View
7 lib/Predis/Connection/PhpiredisConnection.php
@@ -11,12 +11,11 @@
namespace Predis\Connection;
-use Predis\Command\CommandInterface;
-use Predis\ConnectionParametersInterface;
-use Predis\ResponseError;
-use Predis\ResponseQueued;
use Predis\ClientException;
use Predis\NotSupportedException;
+use Predis\ResponseError;
+use Predis\ResponseQueued;
+use Predis\Command\CommandInterface;
/**
* This class provides the implementation of a Predis connection that uses the
View
6 lib/Predis/Connection/PredisCluster.php
@@ -11,12 +11,12 @@
namespace Predis\Connection;
-use Predis\Command\CommandInterface;
-use Predis\Command\Hash\CommandHashStrategy;
-use Predis\Distribution\DistributionStrategyInterface;
use Predis\ClientException;
use Predis\NotSupportedException;
+use Predis\Command\CommandInterface;
+use Predis\Command\Hash\CommandHashStrategy;
use Predis\Distribution\HashRing;
+use Predis\Distribution\DistributionStrategyInterface;
/**
* Abstraction for a cluster of aggregated connections to various Redis servers
View
9 lib/Predis/Connection/RedisCluster.php
@@ -11,11 +11,10 @@
namespace Predis\Connection;
-use Predis\ResponseErrorInterface;
-use Predis\ConnectionFactoryInterface;
-use Predis\Command\CommandInterface;
use Predis\ClientException;
use Predis\NotSupportedException;
+use Predis\ResponseErrorInterface;
+use Predis\Command\CommandInterface;
use Predis\Distribution\CRC16HashGenerator;
/**
@@ -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
3  lib/Predis/Connection/StreamConnection.php
@@ -11,10 +11,9 @@
namespace Predis\Connection;
+use Predis\NotSupportedException;
use Predis\ResponseError;
use Predis\ResponseQueued;
-use Predis\NotSupportedException;
-use Predis\ConnectionParametersInterface;
use Predis\Command\CommandInterface;
use Predis\Iterator\MultiBulkResponseSimple;
View
9 lib/Predis/Connection/WebdisConnection.php
@@ -11,13 +11,12 @@
namespace Predis\Connection;
-use Predis\Command\CommandInterface;
-use Predis\ResponseObjectInterface;
-use Predis\ConnectionParametersInterface;
-use Predis\ResponseError;
use Predis\NotSupportedException;
-use Predis\Protocol\ProtocolException;
+use Predis\ResponseError;
+use Predis\ResponseObjectInterface;
+use Predis\Command\CommandInterface;
use Predis\Connection\ConnectionException;
+use Predis\Protocol\ProtocolException;
/**
* This class implements a Predis connection that actually talks with Webdis
View
4 lib/Predis/Helpers.php
@@ -11,9 +11,9 @@
namespace Predis;
-use Predis\Connection\ConnectionInterface;
-use Predis\Connection\ClusterConnectionInterface;
use Predis\Connection\AggregatedConnectionInterface;
+use Predis\Connection\ClusterConnectionInterface;
+use Predis\Connection\ConnectionInterface;
/**
* Defines a few helper methods.
View
2  lib/Predis/Option/ClientCluster.php
@@ -12,8 +12,8 @@
namespace Predis\Option;
use Predis\Connection\ClusterConnectionInterface;
-use Predis\Connection\RedisCluster;
use Predis\Connection\PredisCluster;
+use Predis\Connection\RedisCluster;
/**
* Option class that returns a connection cluster to be used by a client.
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
2  lib/Predis/Option/ClientReplication.php
@@ -11,8 +11,8 @@
namespace Predis\Option;
-use Predis\Connection\ReplicationConnectionInterface;
use Predis\Connection\MasterSlaveReplication;
+use Predis\Connection\ReplicationConnectionInterface;
/**
* Option class that returns a replication connection be used by a client.
View
8 lib/Predis/Pipeline/MultiExecExecutor.php
@@ -12,14 +12,14 @@
namespace Predis\Pipeline;
use SplQueue;
+use Predis\ClientException;
+use Predis\ResponseQueued;
use Predis\ResponseErrorInterface;
-use Predis\Profile\ServerProfileInterface;
+use Predis\ServerException;
use Predis\Connection\ConnectionInterface;
use Predis\Connection\SingleConnectionInterface;
-use Predis\ResponseQueued;
-use Predis\ClientException;
-use Predis\ServerException;
use Predis\Profile\ServerProfile;
+use Predis\Profile\ServerProfileInterface;
/**
* Implements a pipeline executor that wraps the whole pipeline
View
6 lib/Predis/Pipeline/PipelineContext.php
@@ -12,12 +12,12 @@
namespace Predis\Pipeline;
use SplQueue;
-use Predis\ClientInterface;
use Predis\BasicClientInterface;
+use Predis\ClientException;
+use Predis\ClientInterface;
use Predis\ExecutableContextInterface;
-use Predis\Command\CommandInterface;
use Predis\Helpers;
-use Predis\ClientException;
+use Predis\Command\CommandInterface;
/**
* Abstraction of a pipeline context where write and read operations
View
2  lib/Predis/Pipeline/SafeExecutor.php
@@ -12,8 +12,8 @@
namespace Predis\Pipeline;
use SplQueue;
-use Predis\ServerException;
use Predis\CommunicationException;
+use Predis\ServerException;
use Predis\Connection\ConnectionInterface;
/**
View
2  lib/Predis/Pipeline/StandardExecutor.php
@@ -13,9 +13,9 @@
use SplQueue;
use Predis\ResponseErrorInterface;
+use Predis\ServerException;
use Predis\Connection\ConnectionInterface;
use Predis\Connection\ReplicationConnectionInterface;
-use Predis\ServerException;
/**
* Implements the standard pipeline executor strategy used
View
2  lib/Predis/Profile/ServerProfile.php
@@ -12,8 +12,8 @@
namespace Predis\Profile;
use Predis\ClientException;
-use Predis\Command\Processor\CommandProcessorInterface;
use Predis\Command\Processor\CommandProcessingInterface;
+use Predis\Command\Processor\CommandProcessorInterface;
/**
* Base class that implements common functionalities of server profiles.
View
2  lib/Predis/Protocol/Text/ComposableTextProtocol.php
@@ -12,10 +12,10 @@
namespace Predis\Protocol\Text;
use Predis\Command\CommandInterface;
+use Predis\Connection\ComposableConnectionInterface;
use Predis\Protocol\ResponseReaderInterface;
use Predis\Protocol\CommandSerializerInterface;
use Predis\Protocol\ComposableProtocolInterface;
-use Predis\Connection\ComposableConnectionInterface;
/**
* Implements a customizable protocol processor that uses the standard Redis
View
4 lib/Predis/Protocol/Text/ResponseBulkHandler.php
@@ -12,9 +12,9 @@
namespace Predis\Protocol\Text;
use Predis\Helpers;
-use Predis\Protocol\ResponseHandlerInterface;
-use Predis\Protocol\ProtocolException;
use Predis\Connection\ComposableConnectionInterface;
+use Predis\Protocol\ProtocolException;
+use Predis\Protocol\ResponseHandlerInterface;
/**
* Implements a response handler for bulk replies using the standard wire
View
2  lib/Predis/Protocol/Text/ResponseErrorHandler.php
@@ -12,8 +12,8 @@
namespace Predis\Protocol\Text;
use Predis\ResponseError;
-use Predis\Protocol\ResponseHandlerInterface;
use Predis\Connection\ComposableConnectionInterface;
+use Predis\Protocol\ResponseHandlerInterface;
/**
* Implements a response handler for error replies using the standard wire
View
4 lib/Predis/Protocol/Text/ResponseIntegerHandler.php
@@ -12,9 +12,9 @@
namespace Predis\Protocol\Text;
use Predis\Helpers;
-use Predis\Protocol\ResponseHandlerInterface;
-use Predis\Protocol\ProtocolException;
use Predis\Connection\ComposableConnectionInterface;
+use Predis\Protocol\ProtocolException;
+use Predis\Protocol\ResponseHandlerInterface;
/**
* Implements a response handler for integer replies using the standard wire
View
4 lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php
@@ -12,9 +12,9 @@
namespace Predis\Protocol\Text;
use Predis\Helpers;
-use Predis\Protocol\ResponseHandlerInterface;
-use Predis\Protocol\ProtocolException;
use Predis\Connection\ComposableConnectionInterface;
+use Predis\Protocol\ProtocolException;
+use Predis\Protocol\ResponseHandlerInterface;
/**
* Implements a response handler for multi-bulk replies using the standard
View
4 lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php
@@ -12,10 +12,10 @@
namespace Predis\Protocol\Text;
use Predis\Helpers;
-use Predis\Protocol\ResponseHandlerInterface;
-use Predis\Protocol\ProtocolException;
use Predis\Connection\ComposableConnectionInterface;
use Predis\Iterator\MultiBulkResponseSimple;
+use Predis\Protocol\ProtocolException;
+use Predis\Protocol\ResponseHandlerInterface;
/**
* Implements a response handler for iterable multi-bulk replies using the
View
2  lib/Predis/Protocol/Text/ResponseStatusHandler.php
@@ -12,8 +12,8 @@
namespace Predis\Protocol\Text;
use Predis\ResponseQueued;
-use Predis\Protocol\ResponseHandlerInterface;
use Predis\Connection\ComposableConnectionInterface;
+use Predis\Protocol\ResponseHandlerInterface;
/**
* Implements a response handler for status replies using the standard wire
View
4 lib/Predis/Protocol/Text/TextProtocol.php
@@ -16,10 +16,10 @@
use Predis\ResponseQueued;
use Predis\ServerException;
use Predis\Command\CommandInterface;
-use Predis\Protocol\ProtocolInterface;
-use Predis\Protocol\ProtocolException;
use Predis\Connection\ComposableConnectionInterface;
use Predis\Iterator\MultiBulkResponseSimple;
+use Predis\Protocol\ProtocolException;
+use Predis\Protocol\ProtocolInterface;
/**
* Implements a protocol processor for the standard wire protocol defined by Redis.
View
6 lib/Predis/Protocol/Text/TextResponseReader.php
@@ -12,10 +12,10 @@
namespace Predis\Protocol\Text;
use Predis\Helpers;
-use Predis\Protocol\ResponseReaderInterface;
-use Predis\Protocol\ResponseHandlerInterface;
-use Predis\Protocol\ProtocolException;
use Predis\Connection\ComposableConnectionInterface;
+use Predis\Protocol\ProtocolException;
+use Predis\Protocol\ResponseHandlerInterface;
+use Predis\Protocol\ResponseReaderInterface;
/**
* Implements a pluggable response reader using the standard wire protocol
View
2  lib/Predis/PubSub/AbstractPubSubContext.php
@@ -11,9 +11,9 @@
namespace Predis\PubSub;
+use Predis\ClientException;
use Predis\ClientInterface;
use Predis\Helpers;
-use Predis\ClientException;
use Predis\NotSupportedException;
/**
View
2  lib/Predis/PubSub/PubSubContext.php
@@ -11,9 +11,9 @@
namespace Predis\PubSub;
+use Predis\ClientException;
use Predis\ClientInterface;
use Predis\Helpers;
-use Predis\ClientException;
use Predis\NotSupportedException;
use Predis\Connection\AggregatedConnectionInterface;
View
12 lib/Predis/Transaction/MultiExecContext.php
@@ -12,17 +12,17 @@
namespace Predis\Transaction;
use SplQueue;
-use Predis\ClientInterface;
use Predis\BasicClientInterface;
+use Predis\ClientException;
+use Predis\ClientInterface;
+use Predis\CommunicationException;
use Predis\ExecutableContextInterface;
+use Predis\NotSupportedException;
use Predis\ResponseErrorInterface;
-use Predis\Command\CommandInterface;
-use Predis\Connection\AggregatedConnectionInterface;
use Predis\ResponseQueued;
-use Predis\ClientException;
use Predis\ServerException;
-use Predis\NotSupportedException;
-use Predis\CommunicationException;
+use Predis\Command\CommandInterface;
+use Predis\Connection\AggregatedConnectionInterface;
use Predis\Protocol\ProtocolException;
/**
View
1  tests/PHPUnit/ConnectionTestCase.php
@@ -13,7 +13,6 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\ConnectionParameters;
use Predis\Profile\ServerProfile;
/**
View
7 tests/Predis/ClientTest.php
@@ -13,9 +13,10 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\Profile\ServerProfile;
-use Predis\Connection\PredisCluster;
+use Predis\Connection\ConnectionFactory;
use Predis\Connection\MasterSlaveReplication;
+use Predis\Connection\PredisCluster;
+use Predis\Profile\ServerProfile;
/**
*
@@ -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
3  tests/Predis/Command/Hash/CommandHashStrategyTest.php
@@ -12,8 +12,9 @@
namespace Predis\Command\Hash;
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\Profile\ServerProfile;
+
use Predis\Distribution\HashRing;
+use Predis\Profile\ServerProfile;
/**
*
View
1  tests/Predis/CommunicationExceptionTest.php
@@ -12,6 +12,7 @@
namespace Predis;
use \PHPUnit_Framework_TestCase as StandardTestCase;
+
use Predis\Connection\SingleConnectionInterface;
/**
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);
View
2  tests/Predis/Option/ClientProfileTest.php
@@ -13,8 +13,8 @@
use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\Profile\ServerProfile;
use Predis\Command\Processor\KeyPrefixProcessor;
+use Predis\Profile\ServerProfile;
/**
*
View
1  tests/Predis/Profile/ServerProfileTest.php
@@ -12,6 +12,7 @@
namespace Predis\Profile;
use \PHPUnit_Framework_TestCase as StandardTestCase;
+
use Predis\Command\Processor\ProcessorChain;
/**

No commit comments for this range

Something went wrong with that request. Please try again.