Przeglądaj źródła

Order "use" directives by namespace depth and name.

This is not really useful per se, but at least we use a fixed rule.
Daniele Alessandri 12 lat temu
rodzic
commit
6c732c737b
38 zmienionych plików z 72 dodań i 70 usunięć
  1. 1 1
      examples/CustomDistributionStrategy.php
  2. 1 1
      examples/MasterSlaveReplicationComplex.php
  3. 6 6
      lib/Predis/Client.php
  4. 1 1
      lib/Predis/ClientInterface.php
  5. 0 1
      lib/Predis/Command/AbstractCommand.php
  6. 2 2
      lib/Predis/Connection/AbstractConnection.php
  7. 1 1
      lib/Predis/Connection/ConnectionFactory.php
  8. 1 1
      lib/Predis/Connection/MasterSlaveReplication.php
  9. 3 3
      lib/Predis/Connection/PhpiredisConnection.php
  10. 3 3
      lib/Predis/Connection/PredisCluster.php
  11. 2 2
      lib/Predis/Connection/RedisCluster.php
  12. 1 1
      lib/Predis/Connection/StreamConnection.php
  13. 4 4
      lib/Predis/Connection/WebdisConnection.php
  14. 2 2
      lib/Predis/Helpers.php
  15. 1 1
      lib/Predis/Option/ClientCluster.php
  16. 1 1
      lib/Predis/Option/ClientReplication.php
  17. 4 4
      lib/Predis/Pipeline/MultiExecExecutor.php
  18. 3 3
      lib/Predis/Pipeline/PipelineContext.php
  19. 1 1
      lib/Predis/Pipeline/SafeExecutor.php
  20. 1 1
      lib/Predis/Pipeline/StandardExecutor.php
  21. 1 1
      lib/Predis/Profile/ServerProfile.php
  22. 1 1
      lib/Predis/Protocol/Text/ComposableTextProtocol.php
  23. 2 2
      lib/Predis/Protocol/Text/ResponseBulkHandler.php
  24. 1 1
      lib/Predis/Protocol/Text/ResponseErrorHandler.php
  25. 2 2
      lib/Predis/Protocol/Text/ResponseIntegerHandler.php
  26. 2 2
      lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php
  27. 2 2
      lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php
  28. 1 1
      lib/Predis/Protocol/Text/ResponseStatusHandler.php
  29. 2 2
      lib/Predis/Protocol/Text/TextProtocol.php
  30. 3 3
      lib/Predis/Protocol/Text/TextResponseReader.php
  31. 1 1
      lib/Predis/PubSub/AbstractPubSubContext.php
  32. 1 1
      lib/Predis/PubSub/PubSubContext.php
  33. 6 6
      lib/Predis/Transaction/MultiExecContext.php
  34. 3 3
      tests/Predis/ClientTest.php
  35. 2 1
      tests/Predis/Command/Hash/CommandHashStrategyTest.php
  36. 1 0
      tests/Predis/CommunicationExceptionTest.php
  37. 1 1
      tests/Predis/Option/ClientProfileTest.php
  38. 1 0
      tests/Predis/Profile/ServerProfileTest.php

+ 1 - 1
examples/CustomDistributionStrategy.php

@@ -15,8 +15,8 @@ require 'SharedConfigurations.php';
 // 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
 {

+ 1 - 1
examples/MasterSlaveReplicationComplex.php

@@ -18,9 +18,9 @@ require 'SharedConfigurations.php';
 // 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;
 
 // ------------------------------------------------------------------------- //
 

+ 6 - 6
lib/Predis/Client.php

@@ -12,19 +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\Connection\ConnectionInterface;
 use Predis\Connection\ConnectionFactory;
 use Predis\Connection\ConnectionFactoryInterface;
-use Predis\Profile\ServerProfileInterface;
+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.

+ 1 - 1
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;
 
 /**

+ 0 - 1
lib/Predis/Command/AbstractCommand.php

@@ -11,7 +11,6 @@
 
 namespace Predis\Command;
 
-
 /**
  * Base class for Redis commands.
  *

+ 2 - 2
lib/Predis/Connection/AbstractConnection.php

@@ -11,10 +11,10 @@
 
 namespace Predis\Connection;
 
-use Predis\Helpers;
-use Predis\ResponseObjectInterface;
 use Predis\ClientException;
+use Predis\Helpers;
 use Predis\NotSupportedException;
+use Predis\ResponseObjectInterface;
 use Predis\Command\CommandInterface;
 use Predis\Protocol\ProtocolException;
 

+ 1 - 1
lib/Predis/Connection/ConnectionFactory.php

@@ -11,8 +11,8 @@
 
 namespace Predis\Connection;
 
-use Predis\Profile\ServerProfileInterface;
 use Predis\Profile\ServerProfile;
+use Predis\Profile\ServerProfileInterface;
 
 /**
  * Provides a default factory for Redis connections that maps URI schemes

+ 1 - 1
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

+ 3 - 3
lib/Predis/Connection/PhpiredisConnection.php

@@ -11,11 +11,11 @@
 
 namespace Predis\Connection;
 
-use Predis\Command\CommandInterface;
-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

+ 3 - 3
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

+ 2 - 2
lib/Predis/Connection/RedisCluster.php

@@ -11,10 +11,10 @@
 
 namespace Predis\Connection;
 
-use Predis\ResponseErrorInterface;
-use Predis\Command\CommandInterface;
 use Predis\ClientException;
 use Predis\NotSupportedException;
+use Predis\ResponseErrorInterface;
+use Predis\Command\CommandInterface;
 use Predis\Distribution\CRC16HashGenerator;
 
 /**

+ 1 - 1
lib/Predis/Connection/StreamConnection.php

@@ -11,9 +11,9 @@
 
 namespace Predis\Connection;
 
+use Predis\NotSupportedException;
 use Predis\ResponseError;
 use Predis\ResponseQueued;
-use Predis\NotSupportedException;
 use Predis\Command\CommandInterface;
 use Predis\Iterator\MultiBulkResponseSimple;
 

+ 4 - 4
lib/Predis/Connection/WebdisConnection.php

@@ -11,12 +11,12 @@
 
 namespace Predis\Connection;
 
-use Predis\Command\CommandInterface;
-use Predis\ResponseObjectInterface;
-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

+ 2 - 2
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 4 - 4
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

+ 3 - 3
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

+ 1 - 1
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;
 
 /**

+ 1 - 1
lib/Predis/Pipeline/StandardExecutor.php

@@ -13,9 +13,9 @@ namespace Predis\Pipeline;
 
 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

+ 1 - 1
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.

+ 1 - 1
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

+ 2 - 2
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

+ 1 - 1
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

+ 2 - 2
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

+ 2 - 2
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

+ 2 - 2
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

+ 1 - 1
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

+ 2 - 2
lib/Predis/Protocol/Text/TextProtocol.php

@@ -16,10 +16,10 @@ use Predis\ResponseError;
 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.

+ 3 - 3
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

+ 1 - 1
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;
 
 /**

+ 1 - 1
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;
 

+ 6 - 6
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;
 
 /**

+ 3 - 3
tests/Predis/ClientTest.php

@@ -13,10 +13,10 @@ namespace Predis;
 
 use \PHPUnit_Framework_TestCase as StandardTestCase;
 
-use Predis\Profile\ServerProfile;
-use Predis\Connection\PredisCluster;
-use Predis\Connection\MasterSlaveReplication;
 use Predis\Connection\ConnectionFactory;
+use Predis\Connection\MasterSlaveReplication;
+use Predis\Connection\PredisCluster;
+use Predis\Profile\ServerProfile;
 
 /**
  *

+ 2 - 1
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;
 
 /**
  *

+ 1 - 0
tests/Predis/CommunicationExceptionTest.php

@@ -12,6 +12,7 @@
 namespace Predis;
 
 use \PHPUnit_Framework_TestCase as StandardTestCase;
+
 use Predis\Connection\SingleConnectionInterface;
 
 /**

+ 1 - 1
tests/Predis/Option/ClientProfileTest.php

@@ -13,8 +13,8 @@ namespace Predis\Option;
 
 use \PHPUnit_Framework_TestCase as StandardTestCase;
 
-use Predis\Profile\ServerProfile;
 use Predis\Command\Processor\KeyPrefixProcessor;
+use Predis\Profile\ServerProfile;
 
 /**
  *

+ 1 - 0
tests/Predis/Profile/ServerProfileTest.php

@@ -12,6 +12,7 @@
 namespace Predis\Profile;
 
 use \PHPUnit_Framework_TestCase as StandardTestCase;
+
 use Predis\Command\Processor\ProcessorChain;
 
 /**