浏览代码

Merge branch 'v1.0/inspection-fixes'

Daniele Alessandri 11 年之前
父节点
当前提交
c2b24bd873
共有 100 个文件被更改,包括 534 次插入269 次删除
  1. 4 0
      bin/create-command-test
  2. 4 2
      bin/create-pear
  3. 1 3
      examples/custom_cluster_distributor.php
  4. 1 1
      examples/replication_complex.php
  5. 43 20
      src/Client.php
  6. 7 4
      src/ClientContextInterface.php
  7. 8 5
      src/ClientInterface.php
  8. 30 9
      src/Cluster/ClusterStrategy.php
  9. 8 4
      src/Cluster/Distributor/DistributorInterface.php
  10. 6 3
      src/Cluster/Distributor/HashRing.php
  11. 2 1
      src/Cluster/Hash/HashGeneratorInterface.php
  12. 5 3
      src/Cluster/StrategyInterface.php
  13. 2 0
      src/Collection/Iterator/CursorBasedIterator.php
  14. 2 0
      src/Collection/Iterator/ListKey.php
  15. 10 3
      src/Command/Command.php
  16. 4 2
      src/Command/CommandInterface.php
  17. 2 1
      src/Command/HashScan.php
  18. 2 1
      src/Command/KeyScan.php
  19. 2 1
      src/Command/PubSubPubsub.php
  20. 10 2
      src/Command/RawCommand.php
  21. 2 1
      src/Command/ServerClient.php
  22. 6 3
      src/Command/ServerInfo.php
  23. 2 1
      src/Command/ServerSentinel.php
  24. 2 1
      src/Command/SetScan.php
  25. 2 1
      src/Command/ZSetRange.php
  26. 2 1
      src/Command/ZSetScan.php
  27. 2 1
      src/Command/ZSetUnionStore.php
  28. 2 0
      src/CommunicationException.php
  29. 5 2
      src/Configuration/ClusterOption.php
  30. 5 3
      src/Configuration/OptionInterface.php
  31. 4 0
      src/Configuration/Options.php
  32. 8 4
      src/Configuration/OptionsInterface.php
  33. 2 1
      src/Connection/AbstractConnection.php
  34. 1 1
      src/Connection/Aggregate/MasterSlaveReplication.php
  35. 8 5
      src/Connection/Aggregate/PredisCluster.php
  36. 21 11
      src/Connection/Aggregate/RedisCluster.php
  37. 7 4
      src/Connection/AggregateConnectionInterface.php
  38. 1 0
      src/Connection/CompositeConnectionInterface.php
  39. 4 2
      src/Connection/ConnectionInterface.php
  40. 4 2
      src/Connection/Factory.php
  41. 2 1
      src/Connection/FactoryInterface.php
  42. 8 3
      src/Connection/Parameters.php
  43. 4 2
      src/Connection/ParametersInterface.php
  44. 6 2
      src/Connection/PhpiredisSocketConnection.php
  45. 2 0
      src/Connection/PhpiredisStreamConnection.php
  46. 6 2
      src/Connection/StreamConnection.php
  47. 22 14
      src/Connection/WebdisConnection.php
  48. 3 1
      src/Monitor/Consumer.php
  49. 19 8
      src/Pipeline/Pipeline.php
  50. 4 1
      src/Profile/Factory.php
  51. 8 5
      src/Profile/ProfileInterface.php
  52. 4 1
      src/Profile/RedisProfile.php
  53. 2 1
      src/Protocol/ProtocolProcessorInterface.php
  54. 2 1
      src/Protocol/RequestSerializerInterface.php
  55. 2 1
      src/Protocol/ResponseReaderInterface.php
  56. 7 0
      src/Protocol/Text/CompositeProtocolProcessor.php
  57. 3 0
      src/Protocol/Text/Handler/BulkResponse.php
  58. 3 2
      src/Protocol/Text/Handler/ResponseHandlerInterface.php
  59. 2 0
      src/Protocol/Text/ProtocolProcessor.php
  60. 4 1
      src/Protocol/Text/ResponseReader.php
  61. 6 4
      src/PubSub/AbstractConsumer.php
  62. 3 0
      src/PubSub/Consumer.php
  63. 8 3
      src/Replication/ReplicationStrategy.php
  64. 0 2
      src/Response/Iterator/MultiBulkIterator.php
  65. 2 1
      src/Response/Status.php
  66. 34 7
      src/Transaction/MultiExec.php
  67. 2 1
      src/Transaction/MultiExecState.php
  68. 1 1
      tests/PHPUnit/ArrayHasSameValuesConstraint.php
  69. 6 3
      tests/PHPUnit/PredisCommandTestCase.php
  70. 18 7
      tests/PHPUnit/PredisConnectionTestCase.php
  71. 7 5
      tests/PHPUnit/PredisDistributorTestCase.php
  72. 9 6
      tests/PHPUnit/PredisProfileTestCase.php
  73. 33 21
      tests/PHPUnit/PredisTestCase.php
  74. 2 2
      tests/PHPUnit/RedisCommandConstraint.php
  75. 11 10
      tests/Predis/ClientTest.php
  76. 1 1
      tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php
  77. 0 7
      tests/Predis/Cluster/Distributor/HashRingTest.php
  78. 2 1
      tests/Predis/Cluster/PredisStrategyTest.php
  79. 2 1
      tests/Predis/Cluster/RedisStrategyTest.php
  80. 2 2
      tests/Predis/Collection/Iterator/HashKeyTest.php
  81. 2 2
      tests/Predis/Collection/Iterator/KeyspaceTest.php
  82. 4 4
      tests/Predis/Collection/Iterator/ListKeyTest.php
  83. 2 2
      tests/Predis/Collection/Iterator/SetKeyTest.php
  84. 2 2
      tests/Predis/Collection/Iterator/SortedSetKeyTest.php
  85. 1 1
      tests/Predis/Command/ConnectionSelectTest.php
  86. 1 1
      tests/Predis/Command/HashDeleteTest.php
  87. 1 1
      tests/Predis/Command/HashExistsTest.php
  88. 1 1
      tests/Predis/Command/HashGetAllTest.php
  89. 1 1
      tests/Predis/Command/HashGetMultipleTest.php
  90. 1 1
      tests/Predis/Command/HashGetTest.php
  91. 2 2
      tests/Predis/Command/HashIncrementByFloatTest.php
  92. 2 2
      tests/Predis/Command/HashIncrementByTest.php
  93. 1 1
      tests/Predis/Command/HashKeysTest.php
  94. 1 1
      tests/Predis/Command/HashLengthTest.php
  95. 1 1
      tests/Predis/Command/HashSetMultipleTest.php
  96. 1 1
      tests/Predis/Command/HashSetPreserveTest.php
  97. 1 1
      tests/Predis/Command/HashSetTest.php
  98. 1 1
      tests/Predis/Command/HashValuesTest.php
  99. 1 1
      tests/Predis/Command/HyperLogLogAddTest.php
  100. 2 2
      tests/Predis/Command/HyperLogLogCountTest.php

+ 4 - 0
bin/create-command-test

@@ -134,7 +134,11 @@ class CommandTestCaseGenerator
             throw new RuntimeException("Class $class must implement Predis\Command\CommandInterface.");
         }
 
+        /*
+         * @var CommandInterface
+         */
         $instance = $reflection->newInstance();
+
         $buffer = $this->getTestCaseBuffer($instance);
 
         return $buffer;

+ 4 - 2
bin/create-pear

@@ -46,12 +46,12 @@ function parseAuthor($string)
 
     if (preg_match('/^\s*(.+?)\s*(?:"(\S+)"\s*)?<(\S+)>\s*$/x', $string , $regs)) {
         if (count($regs) == 4) {
-            list($orig,$name,$user,$email) = $regs;
+            list($_,$name,$user,$email) = $regs;
             $author['name'] = $name;
             $author['user'] = $user;
             $author['email'] = $email;
         } elseif (count($regs) == 3) {
-            list($orig,$name,$email) = $regs;
+            list($_,$name,$email) = $regs;
             $author['name'] = $name;
             $author['email'] = $email;
         }
@@ -78,6 +78,8 @@ function parseVersion($string)
             'max' => $regs[2],
         );
     }
+
+    return null;
 }
 
 function addRolePath($pkg, $path, $role)

+ 1 - 3
examples/custom_cluster_distributor.php

@@ -53,9 +53,7 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
 
     public function getBySlot($slot)
     {
-        if (isset($this->nodes[$slot])) {
-            return $this->nodes[$slot];
-        }
+        return isset($this->nodes[$slot]) ? $this->nodes[$slot] : null;
     }
 
     public function getByHash($hash)

+ 1 - 1
examples/replication_complex.php

@@ -58,7 +58,7 @@ $options = array(
 
         return $profile;
     },
-    'replication' => function ($options) {
+    'replication' => function () {
         $strategy = new ReplicationStrategy();
         $strategy->setScriptReadOnly(HashMultipleGetAll::BODY);
 

+ 43 - 20
src/Client.php

@@ -64,7 +64,8 @@ class Client implements ClientInterface
      * types of arguments or simply returns the passed argument if it is an
      * instance of Predis\Configuration\OptionsInterface.
      *
-     * @param  mixed            $options Client options.
+     * @param mixed $options Client options.
+     *
      * @return OptionsInterface
      */
     protected function createOptions($options)
@@ -93,7 +94,8 @@ class Client implements ClientInterface
      *  - String
      *  - Callable
      *
-     * @param  mixed               $parameters Connection parameters or connection instance.
+     * @param mixed $parameters Connection parameters or connection instance.
+     *
      * @return ConnectionInterface
      */
     protected function createConnection($parameters)
@@ -143,7 +145,8 @@ class Client implements ClientInterface
      * Wraps a callable to make sure that its returned value represents a valid
      * connection type.
      *
-     * @param  mixed    $callable
+     * @param mixed $callable
+     *
      * @return \Closure
      */
     protected function getConnectionInitializerWrapper($callable)
@@ -182,7 +185,8 @@ class Client implements ClientInterface
      * only when working with an aggregate connection (cluster, replication).
      * The new client instances uses the same options of the original one.
      *
-     * @param  string $connectionID Identifier of a connection.
+     * @param string $connectionID Identifier of a connection.
+     *
      * @return Client
      */
     public function getClientFor($connectionID)
@@ -243,8 +247,11 @@ class Client implements ClientInterface
      * Retrieves the specified connection from the aggregate connection when the
      * client is in cluster or replication mode.
      *
-     * @param  string                             $connectionID Index or alias of the single connection.
+     * @param string $connectionID Index or alias of the single connection.
+     *
      * @return Connection\NodeConnectionInterface
+     *
+     * @throws NotSupportedException
      */
     public function getConnectionById($connectionID)
     {
@@ -265,8 +272,9 @@ class Client implements ClientInterface
      * It is possibile to indentify Redis error responses from normal responses
      * using the second optional argument which is populated by reference.
      *
-     * @param  array $arguments Command arguments as defined by the command signature.
-     * @param  bool  $error     Set to TRUE when Redis returned an error response.
+     * @param array $arguments Command arguments as defined by the command signature.
+     * @param bool  $error     Set to TRUE when Redis returned an error response.
+     *
      * @return mixed
      */
     public function executeRaw(array $arguments, &$error = null)
@@ -327,9 +335,12 @@ class Client implements ClientInterface
     /**
      * Handles -ERR responses returned by Redis.
      *
-     * @param  CommandInterface       $command  Redis command that generated the error.
-     * @param  ErrorResponseInterface $response Instance of the error response.
+     * @param CommandInterface       $command  Redis command that generated the error.
+     * @param ErrorResponseInterface $response Instance of the error response.
+     *
      * @return mixed
+     *
+     * @throws ServerException
      */
     protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response)
     {
@@ -359,8 +370,9 @@ class Client implements ClientInterface
      * simply an utility method to create Redis contexts instances since they
      * follow a common initialization path.
      *
-     * @param  string $initializer Method name.
-     * @param  array  $argv        Arguments for the method.
+     * @param string $initializer Method name.
+     * @param array  $argv        Arguments for the method.
+     *
      * @return mixed
      */
     private function sharedContextFactory($initializer, $argv = null)
@@ -388,7 +400,8 @@ class Client implements ClientInterface
      * Creates a new pipeline context and returns it, or returns the results of
      * a pipeline executed inside the optionally provided callable object.
      *
-     * @param  mixed          ... Array of options, a callable for execution, or both.
+     * @param mixed ... Array of options, a callable for execution, or both.
+     *
      * @return Pipeline|array
      */
     public function pipeline(/* arguments */)
@@ -399,8 +412,9 @@ class Client implements ClientInterface
     /**
      * Actual pipeline context initializer method.
      *
-     * @param  array          $options  Options for the context.
-     * @param  mixed          $callable Optional callable used to execute the context.
+     * @param array $options  Options for the context.
+     * @param mixed $callable Optional callable used to execute the context.
+     *
      * @return Pipeline|array
      */
     protected function createPipeline(array $options = null, $callable = null)
@@ -413,6 +427,9 @@ class Client implements ClientInterface
             $class = 'Predis\Pipeline\Pipeline';
         }
 
+        /*
+         * @var ClientContextInterface
+         */
         $pipeline = new $class($this);
 
         if (isset($callable)) {
@@ -426,7 +443,8 @@ class Client implements ClientInterface
      * Creates a new transaction context and returns it, or returns the results
      * of a transaction executed inside the optionally provided callable object.
      *
-     * @param  mixed                      ... Array of options, a callable for execution, or both.
+     * @param mixed ... Array of options, a callable for execution, or both.
+     *
      * @return MultiExecTransaction|array
      */
     public function transaction(/* arguments */)
@@ -437,8 +455,9 @@ class Client implements ClientInterface
     /**
      * Actual transaction context initializer method.
      *
-     * @param  array                      $options  Options for the context.
-     * @param  mixed                      $callable Optional callable used to execute the context.
+     * @param array $options  Options for the context.
+     * @param mixed $callable Optional callable used to execute the context.
+     *
      * @return MultiExecTransaction|array
      */
     protected function createTransaction(array $options = null, $callable = null)
@@ -456,7 +475,8 @@ class Client implements ClientInterface
      * Creates a new publis/subscribe context and returns it, or starts its loop
      * inside the optionally provided callable object.
      *
-     * @param  mixed               ... Array of options, a callable for execution, or both.
+     * @param mixed ... Array of options, a callable for execution, or both.
+     *
      * @return PubSubConsumer|NULL
      */
     public function pubSubLoop(/* arguments */)
@@ -467,8 +487,9 @@ class Client implements ClientInterface
     /**
      * Actual publish/subscribe context initializer method.
      *
-     * @param  array               $options  Options for the context.
-     * @param  mixed               $callable Optional callable used to execute the context.
+     * @param array $options  Options for the context.
+     * @param mixed $callable Optional callable used to execute the context.
+     *
      * @return PubSubConsumer|NULL
      */
     protected function createPubSub(array $options = null, $callable = null)
@@ -484,6 +505,8 @@ class Client implements ClientInterface
                 $pubsub->stop();
             }
         }
+
+        return null;
     }
 
     /**

+ 7 - 4
src/ClientContextInterface.php

@@ -162,7 +162,8 @@ interface ClientContextInterface
     /**
      * Sends the specified command instance to Redis.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return mixed
      */
     public function executeCommand(CommandInterface $command);
@@ -170,8 +171,9 @@ interface ClientContextInterface
     /**
      * Sends the specified command with its arguments to Redis.
      *
-     * @param  string $commandID Command ID.
-     * @param  array  $arguments Arguments for the command.
+     * @param string $method    Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return mixed
      */
     public function __call($method, $arguments);
@@ -179,7 +181,8 @@ interface ClientContextInterface
     /**
      * Starts the execution of the context.
      *
-     * @param  mixed $callable Optional callback for execution.
+     * @param mixed $callable Optional callback for execution.
+     *
      * @return array
      */
     public function execute($callable = null);

+ 8 - 5
src/ClientInterface.php

@@ -200,8 +200,9 @@ interface ClientInterface
     /**
      * Creates a new instance of the specified Redis command.
      *
-     * @param  string           $method    Command ID.
-     * @param  array            $arguments Arguments for the command.
+     * @param string $method    Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return CommandInterface
      */
     public function createCommand($method, $arguments = array());
@@ -209,7 +210,8 @@ interface ClientInterface
     /**
      * Executes the specified Redis command.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return mixed
      */
     public function executeCommand(CommandInterface $command);
@@ -218,8 +220,9 @@ interface ClientInterface
      * Creates a Redis command with the specified arguments and sends a request
      * to the server.
      *
-     * @param  string $commandID Command ID.
-     * @param  array  $arguments Arguments for the command.
+     * @param string $method    Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return mixed
      */
     public function __call($method, $arguments);

+ 30 - 9
src/Cluster/ClusterStrategy.php

@@ -210,7 +210,8 @@ abstract class ClusterStrategy implements StrategyInterface
     /**
      * Extracts the key from the first argument of a command instance.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromFirstArgument(CommandInterface $command)
@@ -222,7 +223,8 @@ abstract class ClusterStrategy implements StrategyInterface
      * Extracts the key from a command with multiple keys only when all keys in
      * the arguments array produce the same hash.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromAllArguments(CommandInterface $command)
@@ -232,13 +234,16 @@ abstract class ClusterStrategy implements StrategyInterface
         if ($this->checkSameSlotForKeys($arguments)) {
             return $arguments[0];
         }
+
+        return null;
     }
 
     /**
      * Extracts the key from a command with multiple keys only when all keys in
      * the arguments array produce the same hash.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromInterleavedArguments(CommandInterface $command)
@@ -253,12 +258,15 @@ abstract class ClusterStrategy implements StrategyInterface
         if ($this->checkSameSlotForKeys($keys)) {
             return $arguments[0];
         }
+
+        return null;
     }
 
     /**
      * Extracts the key from BLPOP and BRPOP commands.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromBlockingListCommands(CommandInterface $command)
@@ -268,12 +276,15 @@ abstract class ClusterStrategy implements StrategyInterface
         if ($this->checkSameSlotForKeys(array_slice($arguments, 0, count($arguments) - 1))) {
             return $arguments[0];
         }
+
+        return null;
     }
 
     /**
      * Extracts the key from BITOP command.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromBitOp(CommandInterface $command)
@@ -283,12 +294,15 @@ abstract class ClusterStrategy implements StrategyInterface
         if ($this->checkSameSlotForKeys(array_slice($arguments, 1, count($arguments)))) {
             return $arguments[1];
         }
+
+        return null;
     }
 
     /**
      * Extracts the key from ZINTERSTORE and ZUNIONSTORE commands.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromZsetAggregationCommands(CommandInterface $command)
@@ -299,12 +313,15 @@ abstract class ClusterStrategy implements StrategyInterface
         if ($this->checkSameSlotForKeys($keys)) {
             return $arguments[0];
         }
+
+        return null;
     }
 
     /**
      * Extracts the key from EVAL and EVALSHA commands.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
      */
     protected function getKeyFromScriptingCommands(CommandInterface $command)
@@ -318,6 +335,8 @@ abstract class ClusterStrategy implements StrategyInterface
         if ($keys && $this->checkSameSlotForKeys($keys)) {
             return $keys[0];
         }
+
+        return null;
     }
 
     /**
@@ -347,7 +366,8 @@ abstract class ClusterStrategy implements StrategyInterface
     /**
      * Checks if the specified array of keys will generate the same hash.
      *
-     * @param  array $keys Array of keys.
+     * @param array $keys Array of keys.
+     *
      * @return bool
      */
     protected function checkSameSlotForKeys(array $keys)
@@ -375,7 +395,8 @@ abstract class ClusterStrategy implements StrategyInterface
      * Returns only the hashable part of a key (delimited by "{...}"), or the
      * whole key if a key tag is not found in the string.
      *
-     * @param  string $key A key.
+     * @param string $key A key.
+     *
      * @return string
      */
     protected function extractKeyTag($key)

+ 8 - 4
src/Cluster/Distributor/DistributorInterface.php

@@ -40,7 +40,8 @@ interface DistributorInterface
      * Returns the corresponding slot of a node from the distributor using the
      * computed hash of a key.
      *
-     * @param  mixed $key
+     * @param mixed $hash
+     *
      * @return mixed
      */
     public function getSlot($hash);
@@ -48,7 +49,8 @@ interface DistributorInterface
     /**
      * Returns a node from the distributor using its assigned slot ID.
      *
-     * @param  mixed $key
+     * @param mixed $slot
+     *
      * @return mixed
      */
     public function getBySlot($slot);
@@ -56,7 +58,8 @@ interface DistributorInterface
     /**
      * Returns a node from the distributor using the computed hash of a key.
      *
-     * @param  mixed $hash
+     * @param mixed $hash
+     *
      * @return mixed
      */
     public function getByHash($hash);
@@ -64,7 +67,8 @@ interface DistributorInterface
     /**
      * Returns a node from the distributor mapping to the specified value.
      *
-     * @param  string $value
+     * @param string $value
+     *
      * @return mixed
      */
     public function get($value);

+ 6 - 3
src/Cluster/Distributor/HashRing.php

@@ -204,6 +204,8 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
         if (isset($this->ring[$slot])) {
             return $this->ring[$slot];
         }
+
+        return null;
     }
 
     /**
@@ -247,9 +249,10 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
     /**
      * Implements a strategy to deal with wrap-around errors during binary searches.
      *
-     * @param  int $upper
-     * @param  int $lower
-     * @param  int $ringKeysCount
+     * @param int $upper
+     * @param int $lower
+     * @param int $ringKeysCount
+     *
      * @return int
      */
     protected function wrapAroundStrategy($upper, $lower, $ringKeysCount)

+ 2 - 1
src/Cluster/Hash/HashGeneratorInterface.php

@@ -22,7 +22,8 @@ interface HashGeneratorInterface
     /**
      * Generates an hash from a string to be used for distribution.
      *
-     * @param  string $value String value.
+     * @param string $value String value.
+     *
      * @return int
      */
     public function hash($value);

+ 5 - 3
src/Cluster/StrategyInterface.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Cluster;
 
-use Predis\Cluster\Distribution\DistributorInterface;
+use Predis\Cluster\Distributor\DistributorInterface;
 use Predis\Command\CommandInterface;
 
 /**
@@ -28,7 +28,8 @@ interface StrategyInterface
      * Returns a slot for the given command used for clustering distribution or
      * NULL when this is not possible.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return int
      */
     public function getSlot(CommandInterface $command);
@@ -37,7 +38,8 @@ interface StrategyInterface
      * Returns a slot for the given key used for clustering distribution or NULL
      * when this is not possible.
      *
-     * @param  string $key Key string.
+     * @param string $key Key string.
+     *
      * @return int
      */
     public function getSlotByKey($key);

+ 2 - 0
src/Collection/Iterator/CursorBasedIterator.php

@@ -61,6 +61,8 @@ abstract class CursorBasedIterator implements Iterator
      *
      * @param ClientInterface $client    Client connected to Redis.
      * @param string          $commandID Command ID.
+     *
+     * @throws NotSupportedException
      */
     protected function requiredCommand(ClientInterface $client, $commandID)
     {

+ 2 - 0
src/Collection/Iterator/ListKey.php

@@ -67,6 +67,8 @@ class ListKey implements Iterator
      *
      * @param ClientInterface $client    Client connected to Redis.
      * @param string          $commandID Command ID.
+     *
+     * @throws NotSupportedException
      */
     protected function requiredCommand(ClientInterface $client, $commandID)
     {

+ 10 - 3
src/Command/Command.php

@@ -24,7 +24,8 @@ abstract class Command implements CommandInterface
     /**
      * Returns a filtered array of the arguments.
      *
-     * @param  array $arguments List of arguments.
+     * @param array $arguments List of arguments.
+     *
      * @return array
      */
     protected function filterArguments(array $arguments)
@@ -66,6 +67,8 @@ abstract class Command implements CommandInterface
         if (isset($this->arguments[$index])) {
             return $this->arguments[$index];
         }
+
+        return null;
     }
 
     /**
@@ -84,6 +87,8 @@ abstract class Command implements CommandInterface
         if (isset($this->slot)) {
             return $this->slot;
         }
+
+        return null;
     }
 
     /**
@@ -97,7 +102,8 @@ abstract class Command implements CommandInterface
     /**
      * Normalizes the arguments array passed to a Redis command.
      *
-     * @param  array $arguments Arguments for a command.
+     * @param array $arguments Arguments for a command.
+     *
      * @return array
      */
     public static function normalizeArguments(array $arguments)
@@ -112,7 +118,8 @@ abstract class Command implements CommandInterface
     /**
      * Normalizes the arguments array passed to a variadic Redis command.
      *
-     * @param  array $arguments Arguments for a command.
+     * @param array $arguments Arguments for a command.
+     *
      * @return array
      */
     public static function normalizeVariadic(array $arguments)

+ 4 - 2
src/Command/CommandInterface.php

@@ -64,7 +64,8 @@ interface CommandInterface
     /**
      * Gets the argument of the command at the specified index.
      *
-     * @param  int   $index Index of the desired argument.
+     * @param int $index Index of the desired argument.
+     *
      * @return mixed
      */
     public function getArgument($index);
@@ -72,7 +73,8 @@ interface CommandInterface
     /**
      * Parses a raw response and returns a PHP object.
      *
-     * @param  string $data Binary string containing the whole response.
+     * @param string $data Binary string containing the whole response.
+     *
      * @return mixed
      */
     public function parseResponse($data);

+ 2 - 1
src/Command/HashScan.php

@@ -41,7 +41,8 @@ class HashScan extends Command
     /**
      * Returns a list of options and modifiers compatible with Redis.
      *
-     * @param  array $options List of options.
+     * @param array $options List of options.
+     *
      * @return array
      */
     protected function prepareOptions($options)

+ 2 - 1
src/Command/KeyScan.php

@@ -41,7 +41,8 @@ class KeyScan extends Command
     /**
      * Returns a list of options and modifiers compatible with Redis.
      *
-     * @param  array $options List of options.
+     * @param array $options List of options.
+     *
      * @return array
      */
     protected function prepareOptions($options)

+ 2 - 1
src/Command/PubSubPubsub.php

@@ -42,7 +42,8 @@ class PubSubPubsub extends Command
     /**
      * Returns the processed response to PUBSUB NUMSUB.
      *
-     * @param  array $channels List of channels
+     * @param array $channels List of channels
+     *
      * @return array
      */
     protected static function processNumsub(array $channels)

+ 10 - 2
src/Command/RawCommand.php

@@ -29,6 +29,9 @@ class RawCommand implements CommandInterface
     private $commandID;
     private $arguments;
 
+    /**
+     * @param array $arguments Command ID and its arguments.
+     */
     public function __construct(array $arguments)
     {
         if (!$arguments) {
@@ -44,8 +47,9 @@ class RawCommand implements CommandInterface
     /**
      * Creates a new raw command using a variadic method.
      *
-     * @param  string           $commandID Redis command ID.
-     * @param string ... Arguments list for the command.
+     * @param string $commandID Redis command ID.
+     * @param string ...        Arguments list for the command.
+     *
      * @return CommandInterface
      */
     public static function create($commandID /* [ $arg, ... */)
@@ -97,6 +101,8 @@ class RawCommand implements CommandInterface
         if (isset($this->arguments[$index])) {
             return $this->arguments[$index];
         }
+
+        return null;
     }
 
     /**
@@ -115,6 +121,8 @@ class RawCommand implements CommandInterface
         if (isset($this->slot)) {
             return $this->slot;
         }
+
+        return null;
     }
 
     /**

+ 2 - 1
src/Command/ServerClient.php

@@ -49,7 +49,8 @@ class ServerClient extends Command
     /**
      * Parses the response to CLIENT LIST and returns a structured list.
      *
-     * @param  string $data Response buffer.
+     * @param string $data Response buffer.
+     *
      * @return array
      */
     protected function parseClientList($data)

+ 6 - 3
src/Command/ServerInfo.php

@@ -48,7 +48,8 @@ class ServerInfo extends Command
     /**
      * Parses a single row of the response and returns the key-value pair.
      *
-     * @param  string $row Single row of the response.
+     * @param string $row Single row of the response.
+     *
      * @return array
      */
     protected function parseRow($row)
@@ -65,7 +66,8 @@ class ServerInfo extends Command
     /**
      * Extracts the statistics of each logical DB from the string buffer.
      *
-     * @param  string $str Response buffer.
+     * @param string $str Response buffer.
+     *
      * @return array
      */
     protected function parseDatabaseStats($str)
@@ -83,7 +85,8 @@ class ServerInfo extends Command
     /**
      * Parses the response and extracts the allocation statistics.
      *
-     * @param  string $str Response buffer.
+     * @param string $str Response buffer.
+     *
      * @return array
      */
     protected function parseAllocationStats($str)

+ 2 - 1
src/Command/ServerSentinel.php

@@ -43,7 +43,8 @@ class ServerSentinel extends Command
     /**
      * Returns a processed response to SENTINEL MASTERS or SENTINEL SLAVES.
      *
-     * @param  array $servers List of Redis servers.
+     * @param array $servers List of Redis servers.
+     *
      * @return array
      */
     protected static function processMastersOrSlaves(array $servers)

+ 2 - 1
src/Command/SetScan.php

@@ -41,7 +41,8 @@ class SetScan extends Command
     /**
      * Returns a list of options and modifiers compatible with Redis.
      *
-     * @param  array $options List of options.
+     * @param array $options List of options.
+     *
      * @return array
      */
     protected function prepareOptions($options)

+ 2 - 1
src/Command/ZSetRange.php

@@ -52,7 +52,8 @@ class ZSetRange extends Command
     /**
      * Returns a list of options and modifiers compatible with Redis.
      *
-     * @param  array $options List of options.
+     * @param array $options List of options.
+     *
      * @return array
      */
     protected function prepareOptions($options)

+ 2 - 1
src/Command/ZSetScan.php

@@ -41,7 +41,8 @@ class ZSetScan extends Command
     /**
      * Returns a list of options and modifiers compatible with Redis.
      *
-     * @param  array $options List of options.
+     * @param array $options List of options.
+     *
      * @return array
      */
     protected function prepareOptions($options)

+ 2 - 1
src/Command/ZSetUnionStore.php

@@ -50,7 +50,8 @@ class ZSetUnionStore extends Command
     /**
      * Returns a list of options and modifiers compatible with Redis.
      *
-     * @param  array $options List of options.
+     * @param array $options List of options.
+     *
      * @return array
      */
     private function prepareOptions($options)

+ 2 - 0
src/CommunicationException.php

@@ -63,6 +63,8 @@ abstract class CommunicationException extends PredisException
      * Helper method to handle exceptions generated by a connection object.
      *
      * @param CommunicationException $exception Exception.
+     *
+     * @throws CommunicationException
      */
     public static function handle(CommunicationException $exception)
     {

+ 5 - 2
src/Configuration/ClusterOption.php

@@ -28,8 +28,9 @@ class ClusterOption implements OptionInterface
     /**
      * Creates a new cluster connection from on a known descriptive name.
      *
-     * @param  OptionsInterface $options Instance of the client options.
-     * @param  string           $id      Descriptive identifier of the cluster type (`predis`, `redis-cluster`)
+     * @param OptionsInterface $options Instance of the client options.
+     * @param string           $id      Descriptive identifier of the cluster type (`predis`, `redis-cluster`)
+     *
      * @return ClusterInterface
      */
     protected function createByDescription(OptionsInterface $options, $id)
@@ -44,6 +45,8 @@ class ClusterOption implements OptionInterface
                 return new RedisCluster($options->connections);
 
         }
+
+        return null;
     }
 
     /**

+ 5 - 3
src/Configuration/OptionInterface.php

@@ -22,8 +22,9 @@ interface OptionInterface
     /**
      * Filters and validates the passed value.
      *
-     * @param  OptionsInterface $options Options container.
-     * @param  mixed            $value   Input value.
+     * @param OptionsInterface $options Options container.
+     * @param mixed            $value   Input value.
+     *
      * @return mixed
      */
     public function filter(OptionsInterface $options, $value);
@@ -31,7 +32,8 @@ interface OptionInterface
     /**
      * Returns the default value for the option.
      *
-     * @param  OptionsInterface $options Options container.
+     * @param OptionsInterface $options Options container.
+     *
      * @return mixed
      */
     public function getDefault(OptionsInterface $options);

+ 4 - 0
src/Configuration/Options.php

@@ -63,6 +63,8 @@ class Options implements OptionsInterface
 
             return $handler->getDefault($this);
         }
+
+        return null;
     }
 
     /**
@@ -116,5 +118,7 @@ class Options implements OptionsInterface
         if (isset($this->handlers[$option])) {
             return $this->options[$option] = $this->getDefault($option);
         }
+
+        return null;
     }
 }

+ 8 - 4
src/Configuration/OptionsInterface.php

@@ -29,7 +29,8 @@ interface OptionsInterface
     /**
      * Returns the default value for the given option.
      *
-     * @param  string $option Name of the option.
+     * @param string $option Name of the option.
+     *
      * @return mixed
      */
     public function getDefault($option);
@@ -37,7 +38,8 @@ interface OptionsInterface
     /**
      * Checks if the given option has been set by the user upon initialization.
      *
-     * @param  string $option Name of the option.
+     * @param string $option Name of the option.
+     *
      * @return bool
      */
     public function defined($option);
@@ -45,7 +47,8 @@ interface OptionsInterface
     /**
      * Checks if the given option has been set and does not evaluate to NULL.
      *
-     * @param  string $option Name of the option.
+     * @param string $option Name of the option.
+     *
      * @return bool
      */
     public function __isset($option);
@@ -53,7 +56,8 @@ interface OptionsInterface
     /**
      * Returns the value of the given option.
      *
-     * @param  string $option Name of the option.
+     * @param string $option Name of the option.
+     *
      * @return mixed
      */
     public function __get($option);

+ 2 - 1
src/Connection/AbstractConnection.php

@@ -50,7 +50,8 @@ abstract class AbstractConnection implements NodeConnectionInterface
     /**
      * Checks some of the parameters used to initialize the connection.
      *
-     * @param  ParametersInterface $parameters Initialization parameters for the connection.
+     * @param ParametersInterface $parameters Initialization parameters for the connection.
+     *
      * @return ParametersInterface
      */
     protected function assertParameters(ParametersInterface $parameters)

+ 1 - 1
src/Connection/Aggregate/MasterSlaveReplication.php

@@ -31,7 +31,7 @@ class MasterSlaveReplication implements ReplicationInterface
     protected $current;
 
     /**
-     *
+     * {@inheritdoc}
      */
     public function __construct(ReplicationStrategy $strategy = null)
     {

+ 8 - 5
src/Connection/Aggregate/PredisCluster.php

@@ -112,8 +112,9 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Removes a connection instance using its alias or index.
      *
-     * @param  string $connectionID Alias or index of a connection.
-     * @return bool   Returns true if the connection was in the pool.
+     * @param string $connectionID Alias or index of a connection.
+     *
+     * @return bool Returns true if the connection was in the pool.
      */
     public function removeById($connectionID)
     {
@@ -153,7 +154,8 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Retrieves a connection instance from the cluster using a key.
      *
-     * @param  string                  $key Key string.
+     * @param string $key Key string.
+     *
      * @return NodeConnectionInterface
      */
     public function getConnectionByKey($key)
@@ -168,7 +170,7 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable
      * Returns the underlying command hash strategy used to hash commands by
      * using keys found in their arguments.
      *
-     * @return ClusterStrategyInterface
+     * @return StrategyInterface
      */
     public function getClusterStrategy()
     {
@@ -218,7 +220,8 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Executes the specified Redis command on all the nodes of a cluster.
      *
-     * @param  CommandInterface $command A Redis command.
+     * @param CommandInterface $command A Redis command.
+     *
      * @return array
      */
     public function executeCommandOnNodes(CommandInterface $command)

+ 21 - 11
src/Connection/Aggregate/RedisCluster.php

@@ -21,7 +21,6 @@ use Predis\Cluster\RedisStrategy as RedisClusterStrategy;
 use Predis\Command\CommandInterface;
 use Predis\Command\RawCommand;
 use Predis\Connection\NodeConnectionInterface;
-use Predis\Connection\Factory;
 use Predis\Connection\FactoryInterface;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
 
@@ -132,8 +131,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Removes a connection instance by using its identifier.
      *
-     * @param  string $connectionID Connection identifier.
-     * @return bool   True if the connection was in the pool.
+     * @param string $connectionID Connection identifier.
+     *
+     * @return bool True if the connection was in the pool.
      */
     public function removeById($connectionID)
     {
@@ -179,7 +179,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
      * the CLUSTER SLOTS command against the specified node or a random one from
      * the pool.
      *
-     * @param  NodeConnectionInterface $connection Optional connection instance.
+     * @param NodeConnectionInterface $connection Optional connection instance.
+     *
      * @return array
      */
     public function askSlotsMap(NodeConnectionInterface $connection = null)
@@ -247,7 +248,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
      * slots map, falling back to the same logic used by Redis to initialize a
      * cluster (best-effort).
      *
-     * @param  int    $slot Slot index.
+     * @param int $slot Slot index.
+     *
      * @return string Connection ID.
      */
     protected function guessNode($slot)
@@ -270,7 +272,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Creates a new connection instance from the given connection ID.
      *
-     * @param  string                  $connectionID Identifier for the connection.
+     * @param string $connectionID Identifier for the connection.
+     *
      * @return NodeConnectionInterface
      */
     protected function createConnection($connectionID)
@@ -310,7 +313,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Returns the connection currently associated to a given slot.
      *
-     * @param  int                     $slot Slot index.
+     * @param int $slot Slot index.
+     *
      * @return NodeConnectionInterface
      */
     public function getConnectionBySlot($slot)
@@ -341,6 +345,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
         if (isset($this->pool[$connectionID])) {
             return $this->pool[$connectionID];
         }
+
+        return null;
     }
 
     /**
@@ -353,6 +359,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
         if ($this->pool) {
             return $this->pool[array_rand($this->pool)];
         }
+
+        return null;
     }
 
     /**
@@ -371,8 +379,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
     /**
      * Handles -ERR responses returned by Redis.
      *
-     * @param  CommandInterface       $command Command that generated the -ERR response.
-     * @param  ErrorResponseInterface $error   Redis error response object.
+     * @param CommandInterface       $command Command that generated the -ERR response.
+     * @param ErrorResponseInterface $error   Redis error response object.
+     *
      * @return mixed
      */
     protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $error)
@@ -395,8 +404,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
      * Handles -MOVED responses by executing again the command against the node
      * indicated by the Redis response.
      *
-     * @param  CommandInterface $command Command that generated the -MOVED response.
-     * @param  string           $details Parameters of the -MOVED response.
+     * @param CommandInterface $command Command that generated the -MOVED response.
+     * @param string           $details Parameters of the -MOVED response.
+     *
      * @return mixed
      */
     protected function onMovedResponse(CommandInterface $command, $details)

+ 7 - 4
src/Connection/AggregateConnectionInterface.php

@@ -31,15 +31,17 @@ interface AggregateConnectionInterface extends ConnectionInterface
     /**
      * Removes the specified connection instance from the aggregate connection.
      *
-     * @param  NodeConnectionInterface $connection Connection instance.
-     * @return bool                    Returns true if the connection was in the pool.
+     * @param NodeConnectionInterface $connection Connection instance.
+     *
+     * @return bool Returns true if the connection was in the pool.
      */
     public function remove(NodeConnectionInterface $connection);
 
     /**
      * Returns the connection instance in charge for the given command.
      *
-     * @param  CommandInterface        $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return NodeConnectionInterface
      */
     public function getConnection(CommandInterface $command);
@@ -47,7 +49,8 @@ interface AggregateConnectionInterface extends ConnectionInterface
     /**
      * Returns a connection instance from the aggregate connection by its alias.
      *
-     * @param  string                  $connectionID Connection alias.
+     * @param string $connectionID Connection alias.
+     *
      * @return NodeConnectionInterface
      */
     public function getConnectionById($connectionID);

+ 1 - 0
src/Connection/CompositeConnectionInterface.php

@@ -35,6 +35,7 @@ interface CompositeConnectionInterface extends NodeConnectionInterface
      * Reads the given number of bytes from the connection.
      *
      * @param int $length Number of bytes to read from the connection.
+     *
      * @return string
      */
     public function readBuffer($length);

+ 4 - 2
src/Connection/ConnectionInterface.php

@@ -48,7 +48,8 @@ interface ConnectionInterface
     /**
      * Reads the response to the given command from the connection.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return mixed
      */
     public function readResponse(CommandInterface $command);
@@ -57,7 +58,8 @@ interface ConnectionInterface
      * Writes a request for the given command over the connection and reads back
      * the response returned by Redis.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return mixed
      */
     public function executeCommand(CommandInterface $command);

+ 4 - 2
src/Connection/Factory.php

@@ -34,7 +34,8 @@ class Factory implements FactoryInterface
      * implementing Predis\Connection\NodeConnectionInterface. Optionally,
      * callable objects are used for lazy initialization of connection objects.
      *
-     * @param  mixed $initializer FQN of a connection class or a callable for lazy initialization.
+     * @param mixed $initializer FQN of a connection class or a callable for lazy initialization.
+     *
      * @return mixed
      */
     protected function checkInitializer($initializer)
@@ -117,7 +118,8 @@ class Factory implements FactoryInterface
     /**
      * Creates a connection parameters instance from the supplied argument.
      *
-     * @param  mixed               $parameters Original connection parameters.
+     * @param mixed $parameters Original connection parameters.
+     *
      * @return ParametersInterface
      */
     protected function createParameters($parameters)

+ 2 - 1
src/Connection/FactoryInterface.php

@@ -36,7 +36,8 @@ interface FactoryInterface
     /**
      * Creates a new connection object.
      *
-     * @param  mixed                   $parameters Initialization parameters for the connection.
+     * @param mixed $parameters Initialization parameters for the connection.
+     *
      * @return NodeConnectionInterface
      */
     public function create($parameters);

+ 8 - 3
src/Connection/Parameters.php

@@ -53,7 +53,8 @@ class Parameters implements ParametersInterface
      * Creates a new instance by supplying the initial parameters either in the
      * form of an URI string or a named array.
      *
-     * @param  array|string $parameters Set of connection parameters.
+     * @param array|string $parameters Set of connection parameters.
+     *
      * @return Parameters
      */
     public static function create($parameters)
@@ -68,7 +69,8 @@ class Parameters implements ParametersInterface
     /**
      * Parses an URI string returning an array of connection parameters.
      *
-     * @param  string $uri URI string.
+     * @param string $uri URI string.
+     *
      * @return array
      */
     public static function parse($uri)
@@ -95,7 +97,8 @@ class Parameters implements ParametersInterface
     /**
      * Validates and converts each value of the connection parameters array.
      *
-     * @param  array $parameters Connection parameters.
+     * @param array $parameters Connection parameters.
+     *
      * @return array
      */
     protected function filter(array $parameters)
@@ -111,6 +114,8 @@ class Parameters implements ParametersInterface
         if (isset($this->parameters[$parameter])) {
             return $this->parameters[$parameter];
         }
+
+        return null;
     }
 
     /**

+ 4 - 2
src/Connection/ParametersInterface.php

@@ -38,7 +38,8 @@ interface ParametersInterface
     /**
      * Checks if the specified parameters is set.
      *
-     * @param  string $parameter Name of the parameter.
+     * @param string $parameter Name of the parameter.
+     *
      * @return bool
      */
     public function __isset($parameter);
@@ -46,7 +47,8 @@ interface ParametersInterface
     /**
      * Returns the value of the specified parameter.
      *
-     * @param  string $parameter Name of the parameter.
+     * @param string $parameter Name of the parameter.
+     *
      * @return mixed
      */
     public function __get($parameter);

+ 6 - 2
src/Connection/PhpiredisSocketConnection.php

@@ -226,7 +226,8 @@ class PhpiredisSocketConnection extends AbstractConnection
     /**
      * Gets the address from the connection parameters.
      *
-     * @param  ParametersInterface $parameters Parameters used to initialize the connection.
+     * @param ParametersInterface $parameters Parameters used to initialize the connection.
+     *
      * @return string
      */
     protected static function getAddress(ParametersInterface $parameters)
@@ -251,7 +252,8 @@ class PhpiredisSocketConnection extends AbstractConnection
     /**
      * Opens the actual connection to the server with a timeout.
      *
-     * @param  ParametersInterface $parameters Parameters used to initialize the connection.
+     * @param ParametersInterface $parameters Parameters used to initialize the connection.
+     *
      * @return string
      */
     private function connectWithTimeout(ParametersInterface $parameters)
@@ -364,6 +366,8 @@ class PhpiredisSocketConnection extends AbstractConnection
         } else {
             $this->onProtocolError(phpiredis_reader_get_error($reader));
         }
+
+        return null;
     }
 
     /**

+ 2 - 0
src/Connection/PhpiredisStreamConnection.php

@@ -201,6 +201,8 @@ class PhpiredisStreamConnection extends StreamConnection
         } else {
             $this->onProtocolError(phpiredis_reader_get_error($reader));
         }
+
+        return null;
     }
 
     /**

+ 6 - 2
src/Connection/StreamConnection.php

@@ -61,7 +61,8 @@ class StreamConnection extends AbstractConnection
     /**
      * Initializes a TCP stream resource.
      *
-     * @param  ParametersInterface $parameters Initialization parameters for the connection.
+     * @param ParametersInterface $parameters Initialization parameters for the connection.
+     *
      * @return resource
      */
     protected function tcpStreamInitializer(ParametersInterface $parameters)
@@ -103,7 +104,8 @@ class StreamConnection extends AbstractConnection
     /**
      * Initializes a UNIX stream resource.
      *
-     * @param  ParametersInterface $parameters Initialization parameters for the connection.
+     * @param ParametersInterface $parameters Initialization parameters for the connection.
+     *
      * @return resource
      */
     protected function unixStreamInitializer(ParametersInterface $parameters)
@@ -238,6 +240,8 @@ class StreamConnection extends AbstractConnection
             default:
                 $this->onProtocolError("Unknown response prefix: '$prefix'.");
         }
+
+        return null;
     }
 
     /**

+ 22 - 14
src/Connection/WebdisConnection.php

@@ -61,8 +61,9 @@ class WebdisConnection implements NodeConnectionInterface
         }
 
         $this->parameters = $parameters;
-        $this->resource = $this->createCurl($parameters);
-        $this->reader = $this->createReader($parameters);
+
+        $this->resource = $this->createCurl();
+        $this->reader = $this->createReader();
     }
 
     /**
@@ -77,11 +78,15 @@ class WebdisConnection implements NodeConnectionInterface
 
     /**
      * Helper method used to throw on unsupported methods.
+     *
+     * @param string $method Name of the unsupported method.
+     *
+     * @throws NotSupportedException
      */
-    private function throwNotSupportedException($function)
+    private function throwNotSupportedException($method)
     {
         $class = __CLASS__;
-        throw new NotSupportedException("The method $class::$function() is not supported.");
+        throw new NotSupportedException("The method $class::$method() is not supported.");
     }
 
     /**
@@ -105,11 +110,12 @@ class WebdisConnection implements NodeConnectionInterface
     /**
      * Initializes cURL.
      *
-     * @param  ParametersInterface $parameters Initialization parameters for the connection.
      * @return resource
      */
-    private function createCurl(ParametersInterface $parameters)
+    private function createCurl()
     {
+        $parameters = $this->getParameters();
+
         $options = array(
             CURLOPT_FAILONERROR => true,
             CURLOPT_CONNECTTIMEOUT_MS => $parameters->timeout * 1000,
@@ -131,10 +137,9 @@ class WebdisConnection implements NodeConnectionInterface
     /**
      * Initializes the phpiredis protocol reader.
      *
-     * @param  ParametersInterface $parameters Initialization parameters for the connection.
      * @return resource
      */
-    private function createReader(ParametersInterface $parameters)
+    private function createReader()
     {
         $reader = phpiredis_reader_create();
 
@@ -171,8 +176,9 @@ class WebdisConnection implements NodeConnectionInterface
     /**
      * Feeds the phpredis reader resource with the data read from the network.
      *
-     * @param  resource $resource Reader resource.
-     * @param  string   $buffer   Buffer of data read from a connection.
+     * @param resource $resource Reader resource.
+     * @param string   $buffer   Buffer of data read from a connection.
+     *
      * @return int
      */
     protected function feedReader($resource, $buffer)
@@ -209,8 +215,11 @@ class WebdisConnection implements NodeConnectionInterface
     /**
      * Checks if the specified command is supported by this connection class.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return string
+     *
+     * @throws NotSupportedException
      */
     protected function getCommandId(CommandInterface $command)
     {
@@ -331,9 +340,8 @@ class WebdisConnection implements NodeConnectionInterface
     public function __wakeup()
     {
         $this->assertExtensions();
-        $parameters = $this->getParameters();
 
-        $this->resource = $this->createCurl($parameters);
-        $this->reader = $this->createReader($parameters);
+        $this->resource = $this->createCurl();
+        $this->reader = $this->createReader();
     }
 }

+ 3 - 1
src/Monitor/Consumer.php

@@ -51,6 +51,8 @@ class Consumer implements Iterator
      * needed to initialize a monitor consumer.
      *
      * @param ClientInterface $client Client instance used by the consumer.
+     *
+     * @throws NotSupportedException
      */
     private function assertClient(ClientInterface $client)
     {
@@ -122,7 +124,7 @@ class Consumer implements Iterator
     /**
      * Checks if the the consumer is still in a valid state to continue.
      *
-     * @return Boolean
+     * @return bool
      */
     public function valid()
     {

+ 19 - 8
src/Pipeline/Pipeline.php

@@ -52,8 +52,9 @@ class Pipeline implements ClientContextInterface
     /**
      * Queues a command into the pipeline buffer.
      *
-     * @param  string $method    Command ID.
-     * @param  array  $arguments Arguments for the command.
+     * @param string $method    Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return $this
      */
     public function __call($method, $arguments)
@@ -77,7 +78,8 @@ class Pipeline implements ClientContextInterface
     /**
      * Queues a command instance into the pipeline buffer.
      *
-     * @param  CommandInterface $command Command instance to be queued in the buffer.
+     * @param CommandInterface $command Command instance to be queued in the buffer.
+     *
      * @return $this
      */
     public function executeCommand(CommandInterface $command)
@@ -92,6 +94,8 @@ class Pipeline implements ClientContextInterface
      *
      * @param ConnectionInterface    $connection Redis connection that returned the error.
      * @param ErrorResponseInterface $response   Instance of the error response.
+     *
+     * @throws ServerException
      */
     protected function exception(ConnectionInterface $connection, ErrorResponseInterface $response)
     {
@@ -121,8 +125,9 @@ class Pipeline implements ClientContextInterface
      * Implements the logic to flush the queued commands and read the responses
      * from the current connection.
      *
-     * @param  ConnectionInterface $connection Current connection instance.
-     * @param  SplQueue            $commands   Queued commands.
+     * @param ConnectionInterface $connection Current connection instance.
+     * @param SplQueue            $commands   Queued commands.
+     *
      * @return array
      */
     protected function executePipeline(ConnectionInterface $connection, SplQueue $commands)
@@ -153,7 +158,8 @@ class Pipeline implements ClientContextInterface
     /**
      * Flushes the buffer holding all of the commands queued so far.
      *
-     * @param  bool  $send Specifies if the commands in the buffer should be sent to Redis.
+     * @param bool $send Specifies if the commands in the buffer should be sent to Redis.
+     *
      * @return $this
      */
     public function flushPipeline($send = true)
@@ -172,6 +178,8 @@ class Pipeline implements ClientContextInterface
      * Marks the running status of the pipeline.
      *
      * @param bool $bool Sets the running status of the pipeline.
+     *
+     * @throws ClientException
      */
     private function setRunning($bool)
     {
@@ -185,8 +193,12 @@ class Pipeline implements ClientContextInterface
     /**
      * Handles the actual execution of the whole pipeline.
      *
-     * @param  mixed $callable Optional callback for execution.
+     * @param mixed $callable Optional callback for execution.
+     *
      * @return array
+     *
+     * @throws Exception
+     * @throws InvalidArgumentException
      */
     public function execute($callable = null)
     {
@@ -219,7 +231,6 @@ class Pipeline implements ClientContextInterface
     /**
      * Returns if the pipeline should throw exceptions on server errors.
      *
-     * @todo Awful naming...
      * @return bool
      */
     protected function throwServerExceptions()

+ 4 - 1
src/Profile/Factory.php

@@ -81,8 +81,11 @@ final class Factory
     /**
      * Returns the specified server profile.
      *
-     * @param  string           $version Profile version or alias.
+     * @param string $version Profile version or alias.
+     *
      * @return ProfileInterface
+     *
+     * @throws ClientException
      */
     public static function get($version)
     {

+ 8 - 5
src/Profile/ProfileInterface.php

@@ -32,15 +32,17 @@ interface ProfileInterface
     /**
      * Checks if the profile supports the specified command.
      *
-     * @param  string  $commandID Command ID.
-     * @return Boolean
+     * @param string $commandID Command ID.
+     *
+     * @return bool
      */
     public function supportsCommand($commandID);
 
     /**
      * Checks if the profile supports the specified list of commands.
      *
-     * @param  array  $commandIDs List of command IDs.
+     * @param array $commandIDs List of command IDs.
+     *
      * @return string
      */
     public function supportsCommands(array $commandIDs);
@@ -48,8 +50,9 @@ interface ProfileInterface
     /**
      * Creates a new command instance.
      *
-     * @param  string           $commandID Command ID.
-     * @param  array            $arguments Arguments for the command.
+     * @param string $commandID Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return CommandInterface
      */
     public function createCommand($commandID, $arguments = array());

+ 4 - 1
src/Profile/RedisProfile.php

@@ -68,7 +68,8 @@ abstract class RedisProfile implements ProfileInterface
      * Returns the fully-qualified name of a class representing the specified
      * command ID registered in the current server profile.
      *
-     * @param  string $commandID Command ID.
+     * @param string $commandID Command ID.
+     *
      * @return string
      */
     public function getCommandClass($commandID)
@@ -76,6 +77,8 @@ abstract class RedisProfile implements ProfileInterface
         if (isset($this->commands[$commandID = strtoupper($commandID)])) {
             return $this->commands[$commandID];
         }
+
+        return null;
     }
 
     /**

+ 2 - 1
src/Protocol/ProtocolProcessorInterface.php

@@ -33,7 +33,8 @@ interface ProtocolProcessorInterface
     /**
      * Reads a response from a connection to Redis.
      *
-     * @param  CompositeConnectionInterface $connection Redis connection.
+     * @param CompositeConnectionInterface $connection Redis connection.
+     *
      * @return mixed
      */
     public function read(CompositeConnectionInterface $connection);

+ 2 - 1
src/Protocol/RequestSerializerInterface.php

@@ -23,7 +23,8 @@ interface RequestSerializerInterface
     /**
      * Serializes a Redis command.
      *
-     * @param  CommandInterface $command Redis command.
+     * @param CommandInterface $command Redis command.
+     *
      * @return string
      */
     public function serialize(CommandInterface $command);

+ 2 - 1
src/Protocol/ResponseReaderInterface.php

@@ -24,7 +24,8 @@ interface ResponseReaderInterface
     /**
      * Reads a response from a connection to Redis.
      *
-     * @param  CompositeConnectionInterface $connection Redis connection.
+     * @param CompositeConnectionInterface $connection Redis connection.
+     *
      * @return mixed
      */
     public function read(CompositeConnectionInterface $connection);

+ 7 - 0
src/Protocol/Text/CompositeProtocolProcessor.php

@@ -26,7 +26,14 @@ use Predis\Protocol\ResponseReaderInterface;
  */
 class CompositeProtocolProcessor implements ProtocolProcessorInterface
 {
+    /*
+     * @var RequestSerializerInterface
+     */
     protected $serializer;
+
+    /*
+     * @var ResponseReaderInterface
+     */
     protected $reader;
 
     /**

+ 3 - 0
src/Protocol/Text/Handler/BulkResponse.php

@@ -44,5 +44,8 @@ class BulkResponse implements ResponseHandlerInterface
         if ($length == -1) {
             return null;
         }
+
+        // TODO: we should probably check if < -1, just to make sure.
+        return null;
     }
 }

+ 3 - 2
src/Protocol/Text/Handler/ResponseHandlerInterface.php

@@ -24,8 +24,9 @@ interface ResponseHandlerInterface
      * Deserializes a response returned by Redis and reads more data from the
      * connection if needed.
      *
-     * @param  CompositeConnectionInterface $connection Redis connection.
-     * @param  string                       $payload    String payload.
+     * @param CompositeConnectionInterface $connection Redis connection.
+     * @param string                       $payload    String payload.
+     *
      * @return mixed
      */
     public function handle(CompositeConnectionInterface $connection, $payload);

+ 2 - 0
src/Protocol/Text/ProtocolProcessor.php

@@ -98,6 +98,8 @@ class ProtocolProcessor implements ProtocolProcessorInterface
                 CommunicationException::handle(new ProtocolException(
                     $connection, "Unknown response prefix: '$prefix'."
                 ));
+
+                return null;
         }
     }
 

+ 4 - 1
src/Protocol/Text/ResponseReader.php

@@ -64,7 +64,8 @@ class ResponseReader implements ResponseReaderInterface
     /**
      * Returns the response handler associated to a certain type of response.
      *
-     * @param  string                           $prefix Identifier of the type of response.
+     * @param string $prefix Identifier of the type of response.
+     *
      * @return Handler\ResponseHandlerInterface
      */
     public function getHandler($prefix)
@@ -72,6 +73,8 @@ class ResponseReader implements ResponseReaderInterface
         if (isset($this->handlers[$prefix])) {
             return $this->handlers[$prefix];
         }
+
+        return null;
     }
 
     /**

+ 6 - 4
src/PubSub/AbstractConsumer.php

@@ -46,8 +46,9 @@ abstract class AbstractConsumer implements Iterator
     /**
      * Checks if the specified flag is valid based on the state of the consumer.
      *
-     * @param  int     $value Flag.
-     * @return Boolean
+     * @param int $value Flag.
+     *
+     * @return bool
      */
     protected function isFlagSet($value)
     {
@@ -111,7 +112,8 @@ abstract class AbstractConsumer implements Iterator
      * Closes the context by unsubscribing from all the subscribed channels. The
      * context can be forcefully closed by dropping the underlying connection.
      *
-     * @param  bool $drop Indicates if the context should be closed by dropping the connection.
+     * @param bool $drop Indicates if the context should be closed by dropping the connection.
+     *
      * @return bool Returns false when there are no pending messages.
      */
     public function stop($drop = false)
@@ -190,7 +192,7 @@ abstract class AbstractConsumer implements Iterator
     /**
      * Checks if the the consumer is still in a valid state to continue.
      *
-     * @return Boolean
+     * @return bool
      */
     public function valid()
     {

+ 3 - 0
src/PubSub/Consumer.php

@@ -56,6 +56,8 @@ class Consumer extends AbstractConsumer
      * initialize a PUB/SUB consumer.
      *
      * @param ClientInterface $client Client instance used by the consumer.
+     *
+     * @throws NotSupportedException
      */
     private function checkCapabilities(ClientInterface $client)
     {
@@ -121,6 +123,7 @@ class Consumer extends AbstractConsumer
                 }
                 // The missing break here is intentional as we must process
                 // subscriptions and unsubscriptions as standard messages.
+                // no break
 
             case self::MESSAGE:
                 return (object) array(

+ 8 - 3
src/Replication/ReplicationStrategy.php

@@ -39,8 +39,11 @@ class ReplicationStrategy
      * Returns if the specified command will perform a read-only operation
      * on Redis or not.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return bool
+     *
+     * @throws NotSupportedException
      */
     public function isReadOperation(CommandInterface $command)
     {
@@ -77,7 +80,8 @@ class ReplicationStrategy
      * Returns if the specified command is not allowed for execution in a master
      * / slave replication context.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return bool
      */
     public function isDisallowedOperation(CommandInterface $command)
@@ -89,7 +93,8 @@ class ReplicationStrategy
      * Checks if a SORT command is a readable operation by parsing the arguments
      * array of the specified commad instance.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return bool
      */
     protected function isSortReadOnly(CommandInterface $command)

+ 0 - 2
src/Response/Iterator/MultiBulkIterator.php

@@ -65,8 +65,6 @@ abstract class MultiBulkIterator implements Iterator, Countable, ResponseInterfa
         if (++$this->position < $this->size) {
             $this->current = $this->getValue();
         }
-
-        return $this->position;
     }
 
     /**

+ 2 - 1
src/Response/Status.php

@@ -57,7 +57,8 @@ class Status implements ResponseInterface
      * Common status responses such as OK or QUEUED are cached in order to lower
      * the global memory usage especially when using pipelines.
      *
-     * @param  string $payload Status response payload.
+     * @param string $payload Status response payload.
+     *
      * @return string
      */
     public static function get($payload)

+ 34 - 7
src/Transaction/MultiExec.php

@@ -64,6 +64,8 @@ class MultiExec implements ClientContextInterface
      * needed to initialize the transaction object.
      *
      * @param ClientInterface $client Client instance used by the transaction object.
+     *
+     * @throws NotSupportedException
      */
     private function preconditions(ClientInterface $client)
     {
@@ -151,8 +153,9 @@ class MultiExec implements ClientContextInterface
     /**
      * Dynamically invokes a Redis command with the specified arguments.
      *
-     * @param  string $method    Command ID.
-     * @param  array  $arguments Arguments for the command.
+     * @param string $method    Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return mixed
      */
     public function __call($method, $arguments)
@@ -166,9 +169,12 @@ class MultiExec implements ClientContextInterface
     /**
      * Executes a Redis command bypassing the transaction logic.
      *
-     * @param  string $commandID Command ID.
-     * @param  array  $arguments Arguments for the command.
+     * @param string $commandID Command ID.
+     * @param array  $arguments Arguments for the command.
+     *
      * @return mixed
+     *
+     * @throws ServerException
      */
     protected function call($commandID, $arguments = array())
     {
@@ -185,8 +191,12 @@ class MultiExec implements ClientContextInterface
     /**
      * Executes the specified Redis command.
      *
-     * @param  CommandInterface $command Command instance.
+     * @param CommandInterface $command Command instance.
+     *
      * @return $this|mixed
+     *
+     * @throws AbortedMultiExecException
+     * @throws CommunicationException
      */
     public function executeCommand(CommandInterface $command)
     {
@@ -212,8 +222,12 @@ class MultiExec implements ClientContextInterface
     /**
      * Executes WATCH against one or more keys.
      *
-     * @param  string|array $keys One or more keys.
+     * @param string|array $keys One or more keys.
+     *
      * @return mixed
+     *
+     * @throws NotSupportedException
+     * @throws ClientException
      */
     public function watch($keys)
     {
@@ -253,6 +267,8 @@ class MultiExec implements ClientContextInterface
      * Executes UNWATCH.
      *
      * @return MultiExec
+     *
+     * @throws NotSupportedException
      */
     public function unwatch()
     {
@@ -298,6 +314,9 @@ class MultiExec implements ClientContextInterface
      * Checks the state of the transaction before execution.
      *
      * @param mixed $callable Callback for execution.
+     *
+     * @throws InvalidArgumentException
+     * @throws ClientException
      */
     private function checkBeforeExecution($callable)
     {
@@ -331,8 +350,13 @@ class MultiExec implements ClientContextInterface
     /**
      * Handles the actual execution of the whole transaction.
      *
-     * @param  mixed $callable Optional callback for execution.
+     * @param mixed $callable Optional callback for execution.
+     *
      * @return array
+     *
+     * @throws CommunicationException
+     * @throws AbortedMultiExecException
+     * @throws ServerException
      */
     public function execute($callable = null)
     {
@@ -396,6 +420,9 @@ class MultiExec implements ClientContextInterface
      * Passes the current transaction object to a callable block for execution.
      *
      * @param mixed $callable Callback.
+     *
+     * @throws CommunicationException
+     * @throws ServerException
      */
     protected function executeTransactionBlock($callable)
     {

+ 2 - 1
src/Transaction/MultiExecState.php

@@ -77,7 +77,8 @@ class MultiExecState
     /**
      * Returns if the specified flag or set of flags is set.
      *
-     * @param  int  $flags Flag
+     * @param int $flags Flag
+     *
      * @return bool
      */
     public function check($flags)

+ 1 - 1
tests/PHPUnit/ArrayHasSameValuesConstraint.php

@@ -12,7 +12,7 @@
 /**
  * Constraint that accepts arrays with the same elements but different order.
  */
-class ArrayHasSameValuesConstraint extends PHPUnit_Framework_Constraint
+class ArrayHasSameValuesConstraint extends \PHPUnit_Framework_Constraint
 {
     protected $array;
 

+ 6 - 3
tests/PHPUnit/PredisCommandTestCase.php

@@ -49,7 +49,8 @@ abstract class PredisCommandTestCase extends PredisTestCase
     /**
      * Returns a new client instance.
      *
-     * @param  bool   $flushdb Flush selected database before returning the client.
+     * @param bool $flushdb Flush selected database before returning the client.
+     *
      * @return Client
      */
     public function getClient($flushdb = true)
@@ -70,7 +71,7 @@ abstract class PredisCommandTestCase extends PredisTestCase
     /**
      * Returns wether the command is prefixable or not.
      *
-     * @return Boolean
+     * @return bool
      */
     protected function isPrefixable()
     {
@@ -81,6 +82,7 @@ abstract class PredisCommandTestCase extends PredisTestCase
      * Returns a new command instance with the specified arguments.
      *
      * @param ... List of arguments for the command.
+     *
      * @return CommandInterface
      */
     protected function getCommandWithArguments(/* arguments */)
@@ -91,7 +93,8 @@ abstract class PredisCommandTestCase extends PredisTestCase
     /**
      * Returns a new command instance with the specified arguments.
      *
-     * @param  array            $arguments Arguments for the command.
+     * @param array $arguments Arguments for the command.
+     *
      * @return CommandInterface
      */
     protected function getCommandWithArgumentsArray(array $arguments)

+ 18 - 7
tests/PHPUnit/PredisConnectionTestCase.php

@@ -22,7 +22,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
     /**
      * @group disconnected
      * @group slow
-     * @expectedException Predis\Connection\ConnectionException
+     * @expectedException \Predis\Connection\ConnectionException
      */
     public function testThrowExceptionWhenUnableToConnect()
     {
@@ -116,6 +116,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testExecutesCommandOnServer()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile);
 
         $cmdPing = $this->getMock($profile->getCommandClass('ping'), array('parseResponse'));
@@ -130,6 +131,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testWritesCommandToServer()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile);
 
         $cmdEcho = $this->getMock($profile->getCommandClass('echo'), array('parseResponse'));
@@ -146,6 +148,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsCommandFromServer()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile);
 
         $cmdEcho = $this->getMock($profile->getCommandClass('echo'), array('parseResponse'));
@@ -162,7 +165,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testIsAbleToWriteMultipleCommandsAndReadThemBackForPipelining()
     {
-        $connection = $this->getConnection($profile);
+        $profile = $this->getProfile();
 
         $cmdPing = $this->getMock($profile->getCommandClass('ping'), array('parseResponse'));
         $cmdPing->expects($this->never())
@@ -187,6 +190,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testSendsInitializationCommandsOnConnection()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $cmdPing = $this->getMock($profile->getCommandClass('ping'), array('getArguments'));
@@ -210,6 +214,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsStatusResponses()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->writeRequest($profile->createCommand('set', array('foo', 'bar')));
@@ -229,6 +234,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsBulkResponses()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('set', array('foo', 'bar')));
@@ -245,6 +251,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsIntegerResponses()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('rpush', array('metavars', 'foo', 'hoge', 'lol')));
@@ -258,6 +265,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsErrorResponsesAsResponseErrorObjects()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('set', array('foo', 'bar')));
@@ -272,6 +280,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
      */
     public function testReadsMultibulkResponsesAsArrays()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true);
 
         $connection->executeCommand($profile->createCommand('rpush', array('metavars', 'foo', 'hoge', 'lol')));
@@ -283,7 +292,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase
     /**
      * @group connected
      * @group slow
-     * @expectedException Predis\Connection\ConnectionException
+     * @expectedException \Predis\Connection\ConnectionException
      */
     public function testThrowsExceptionOnConnectionTimeout()
     {
@@ -295,10 +304,11 @@ abstract class PredisConnectionTestCase extends PredisTestCase
     /**
      * @group connected
      * @group slow
-     * @expectedException Predis\Connection\ConnectionException
+     * @expectedException \Predis\Connection\ConnectionException
      */
     public function testThrowsExceptionOnReadWriteTimeout()
     {
+        $profile = $this->getProfile();
         $connection = $this->getConnection($profile, true, array('read_write_timeout' => 0.5));
 
         $connection->executeCommand($profile->createCommand('brpop', array('foo', 3)));
@@ -327,9 +337,10 @@ abstract class PredisConnectionTestCase extends PredisTestCase
     /**
      * Returns a new instance of a connection instance.
      *
-     * @param  Profile\ProfileInterface $profile    Reference to the server profile instance.
-     * @param  Boolean                  $initialize Push default initialization commands (SELECT and FLUSHDB).
-     * @param  array                    $parameters Additional connection parameters.
+     * @param Profile\ProfileInterface $profile    Reference to the server profile instance.
+     * @param bool                     $initialize Push default initialization commands (SELECT and FLUSHDB).
+     * @param array                    $parameters Additional connection parameters.
+     *
      * @return StreamConnection
      */
     abstract protected function getConnection(&$profile = null, $initialize = false, array $parameters = array());

+ 7 - 5
tests/PHPUnit/PredisDistributorTestCase.php

@@ -21,16 +21,17 @@ abstract class PredisDistributorTestCase extends PredisTestCase
     /**
      * Returns a new instance of the tested distributor.
      *
-     * @return Predis\Cluster\Distributor\DistributorInterface
+     * @return \Predis\Cluster\Distributor\DistributorInterface
      */
     abstract protected function getDistributorInstance();
 
     /**
      * Returns a list of nodes from the hashring.
      *
-     * @param  DistributorInterface $distributor Distributor instance.
-     * @param  int                  $iterations  Number of nodes to fetch.
-     * @return array                Nodes from the hashring.
+     * @param DistributorInterface $distributor Distributor instance.
+     * @param int                  $iterations  Number of nodes to fetch.
+     *
+     * @return array Nodes from the hashring.
      */
     protected function getNodes(DistributorInterface $distributor, $iterations = 10)
     {
@@ -47,7 +48,8 @@ abstract class PredisDistributorTestCase extends PredisTestCase
     /**
      * Returns a distributor instance with the specified nodes added.
      *
-     * @param  array                $nodes Nodes to add to the distributor.
+     * @param array $nodes Nodes to add to the distributor.
+     *
      * @return DistributorInterface
      */
     protected function getSampleDistribution(array $nodes)

+ 9 - 6
tests/PHPUnit/PredisProfileTestCase.php

@@ -12,6 +12,7 @@
 namespace Predis\Profile;
 
 use PredisTestCase;
+use Predis\Command\CommandInterface;
 use Predis\Command\Processor\ProcessorChain;
 
 /**
@@ -22,7 +23,8 @@ abstract class PredisProfileTestCase extends PredisTestCase
     /**
      * Returns a new instance of the tested profile.
      *
-     * @param  string           $version Version of Redis.
+     * @param string $version Version of Redis.
+     *
      * @return ProfileInterface
      */
     protected function getProfile($version = null)
@@ -48,7 +50,8 @@ abstract class PredisProfileTestCase extends PredisTestCase
      * Returns the list of commands supported by the current
      * server profile.
      *
-     * @param  ProfileInterface $profile Server profile instance.
+     * @param ProfileInterface $profile Server profile instance.
+     *
      * @return array
      */
     protected function getCommands(ProfileInterface $profile)
@@ -149,7 +152,7 @@ abstract class PredisProfileTestCase extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException InvalidArgumentException
+     * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage The class 'stdClass' is not a valid command class.
      */
     public function testDefineInvalidCommand()
@@ -188,7 +191,7 @@ abstract class PredisProfileTestCase extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException Predis\ClientException
+     * @expectedException \Predis\ClientException
      * @expectedExceptionMessage Command 'UNKNOWN' is not a registered Redis command.
      */
     public function testCreateUndefinedCommand()
@@ -248,13 +251,13 @@ abstract class PredisProfileTestCase extends PredisTestCase
         $processor->expects($this->once())
                   ->method('process')
                   ->with($this->isInstanceOf('Predis\Command\CommandInterface'))
-                  ->will($this->returnCallback(function ($cmd) use (&$argsRef) {
+                  ->will($this->returnCallback(function (CommandInterface $cmd) use (&$argsRef) {
                         $cmd->setRawArguments($argsRef = array_map('strtoupper', $cmd->getArguments()));
                     }));
 
         $profile = $this->getProfile();
         $profile->setProcessor($processor);
-        $command = $profile->createCommand('set', array('foo', 'bar'));
+        $profile->createCommand('set', array('foo', 'bar'));
 
         $this->assertSame(array('FOO', 'BAR'), $argsRef);
     }

+ 33 - 21
tests/PHPUnit/PredisTestCase.php

@@ -17,7 +17,7 @@ use Predis\Profile;
 /**
  * Base test case class for the Predis test suite.
  */
-abstract class PredisTestCase extends PHPUnit_Framework_TestCase
+abstract class PredisTestCase extends \PHPUnit_Framework_TestCase
 {
     protected $redisServerVersion = null;
 
@@ -25,8 +25,9 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
      * Verifies that a Redis command is a valid Predis\Command\CommandInterface
      * instance with the specified ID and command arguments.
      *
-     * @param  string|CommandInterface $command   Expected command or command ID.
-     * @param  array                   $arguments Expected command arguments.
+     * @param string|Command\CommandInterface $command   Expected command or command ID.
+     * @param array                           $arguments Expected command arguments.
+     *
      * @return RedisCommandConstraint
      */
     public function isRedisCommand($command = null, array $arguments = null)
@@ -40,9 +41,9 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
      * not check for identity when passing a Predis\Command\CommandInterface
      * instance for $expected.
      *
-     * @param array|string|CommandInterface $expected Expected command.
-     * @param mixed                         $actual   Actual command.
-     * @param string                        $message  Optional assertion message.
+     * @param array|string|Command\CommandInterface $expected Expected command.
+     * @param mixed                                 $actual   Actual command.
+     * @param string                                $message  Optional assertion message.
      */
     public function assertRedisCommand($expected, $actual, $message = '')
     {
@@ -99,7 +100,8 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
      * Returns a named array with the default connection parameters merged with
      * the specified additional parameters.
      *
-     * @param  array $additional Additional connection parameters.
+     * @param array $additional Additional connection parameters.
+     *
      * @return array Connection parameters.
      */
     protected function getParametersArray(array $additional)
@@ -110,8 +112,9 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     /**
      * Returns a new instance of connection parameters.
      *
-     * @param  array                 $additional Additional connection parameters.
-     * @return Connection\Parameters Default connection parameters.
+     * @param array $additional Additional connection parameters.
+     *
+     * @return Connection\Parameters
      */
     protected function getParameters($additional = array())
     {
@@ -124,7 +127,8 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     /**
      * Returns a new instance of server profile.
      *
-     * @param  string                   $version Redis profile.
+     * @param string $version Redis profile.
+     *
      * @return Profile\ProfileInterface
      */
     protected function getProfile($version = null)
@@ -135,9 +139,10 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     /**
      * Returns a new client instance.
      *
-     * @param  array  $parameters Additional connection parameters.
-     * @param  array  $options    Additional client options.
-     * @param  bool   $flushdb    Flush selected database before returning the client.
+     * @param array $parameters Additional connection parameters.
+     * @param array $options    Additional client options.
+     * @param bool  $flushdb    Flush selected database before returning the client.
+     *
      * @return Client
      */
     protected function createClient(array $parameters = null, array $options = null, $flushdb = true)
@@ -168,6 +173,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
      * Returns the server version of the Redis instance used by the test suite.
      *
      * @return string
+     *
      * @throws RuntimeException When the client cannot retrieve the current server version
      */
     protected function getRedisServerVersion()
@@ -195,10 +201,13 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     }
 
     /**
-     * @param  string                             $expectedVersion Expected redis version.
-     * @param  string                             $operator        Comparison operator.
-     * @param  callable                           $callback        Callback for matching version.
-     * @throws PHPUnit_Framework_SkippedTestError When expected redis version is not met
+     * @param string   $expectedVersion Expected redis version.
+     * @param string   $operator        Comparison operator.
+     * @param callable $callback        Callback for matching version.
+     *
+     * @return string
+     *
+     * @throws \PHPUnit_Framework_SkippedTestError When expected redis version is not met
      */
     protected function executeOnRedisVersion($expectedVersion, $operator, $callback)
     {
@@ -213,10 +222,13 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     }
 
     /**
-     * @param  string                             $expectedVersion Expected redis version.
-     * @param  string                             $operator        Comparison operator.
-     * @param  callable                           $callback        Callback for matching version.
-     * @throws PHPUnit_Framework_SkippedTestError When expected redis version is not met
+     * @param string   $expectedVersion Expected redis version.
+     * @param string   $operator        Comparison operator.
+     * @param callable $callback        Callback for matching version.
+     *
+     * @return string
+     *
+     * @throws \PHPUnit_Framework_SkippedTestError When expected redis version is not met
      */
     protected function executeOnProfileVersion($expectedVersion, $operator, $callback)
     {

+ 2 - 2
tests/PHPUnit/RedisCommandConstraint.php

@@ -14,7 +14,7 @@ use Predis\Command\CommandInterface;
 /**
  * Constraint that verifies a redis command.
  */
-class RedisCommandConstraint extends PHPUnit_Framework_Constraint
+class RedisCommandConstraint extends \PHPUnit_Framework_Constraint
 {
     protected $commandID;
     protected $arguments;
@@ -80,7 +80,7 @@ class RedisCommandConstraint extends PHPUnit_Framework_Constraint
 
         if ($this->arguments) {
             $string .= " and the following arguments:\n\n";
-            $string .= PHPUnit_Util_Type::export($this->arguments);
+            $string .= \PHPUnit_Util_Type::export($this->arguments);
         }
 
         return $string;

+ 11 - 10
tests/Predis/ClientTest.php

@@ -213,7 +213,7 @@ class ClientTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException UnexpectedValueException
+     * @expectedException \UnexpectedValueException
      * @expectedExceptionMessage The callable connection initializer returned an invalid type.
      */
     public function testConstructorWithCallableConnectionInitializerThrowsExceptionOnInvalidReturnType()
@@ -226,7 +226,7 @@ class ClientTest extends PredisTestCase
                  ->with($this->isInstanceOf('Predis\Configuration\OptionsInterface'))
                  ->will($this->returnValue($wrongType));
 
-        $client = new Client($callable);
+        new Client($callable);
     }
 
     /**
@@ -293,7 +293,7 @@ class ClientTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException UnexpectedValueException
+     * @expectedException \UnexpectedValueException
      * @expectedExceptionMessage The callable connection initializer returned an invalid type.
      */
     public function testConstructorWithArrayAndOptionAggregateThrowsExceptionOnInvalidReturnType()
@@ -308,7 +308,7 @@ class ClientTest extends PredisTestCase
 
         $arg2 = array('aggregate' => function () use ($fnaggregate) { return $fnaggregate; });
 
-        $client = new Client($arg1, $arg2);
+        new Client($arg1, $arg2);
     }
 
     /**
@@ -394,7 +394,7 @@ class ClientTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testExecuteCommandThrowsExceptionOnRedisError()
@@ -457,7 +457,7 @@ class ClientTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testCallingRedisCommandThrowsExceptionOnServerError()
@@ -565,7 +565,7 @@ class ClientTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException Predis\ClientException
+     * @expectedException \Predis\ClientException
      * @expectedExceptionMessage Command 'INVALIDCOMMAND' is not a registered Redis command.
      */
     public function testThrowsExceptionOnNonRegisteredRedisCommand()
@@ -591,7 +591,7 @@ class ClientTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException Predis\NotSupportedException
+     * @expectedException \Predis\NotSupportedException
      * @expectedExceptionMessage Retrieving connections by ID is supported only by aggregate connections.
      */
     public function testGetConnectionByIdWorksOnlyWithAggregateConnections()
@@ -824,8 +824,9 @@ class ClientTest extends PredisTestCase
     /**
      * Returns an URI string representation of the specified connection parameters.
      *
-     * @param  array  $parameters Array of connection parameters.
-     * @return String URI string.
+     * @param array $parameters Array of connection parameters.
+     *
+     * @return string URI string.
      */
     protected function getParametersString(array $parameters)
     {

+ 1 - 1
tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php

@@ -20,7 +20,7 @@ class EmptyRingExceptionTest extends PredisTestCase
 {
     /**
      * @group disconnected
-     * @expectedException Predis\Cluster\Distributor\EmptyRingException
+     * @expectedException \Predis\Cluster\Distributor\EmptyRingException
      */
     public function testExceptionMessage()
     {

+ 0 - 7
tests/Predis/Cluster/Distributor/HashRingTest.php

@@ -174,13 +174,6 @@ class HashRingTest extends PredisDistributorTestCase
             '127.0.0.1:7002',
         ));
 
-/*
-$hash = $ring->hash('uid:641');
-$slot32 = $ring->getSlot($hash);
-$slot64 = sprintf("%u", $slot32 & 0xffffffff);
-echo "32: $slot32 - 64: $slot64\n";
-exit();
-*/
         $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1255075679 : 3039891617)); // uid:256
         $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1642314910 : 2652652386)); // uid:281
         $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ?  -687739295 : 3607228001)); // uid:312

+ 2 - 1
tests/Predis/Cluster/PredisStrategyTest.php

@@ -247,7 +247,8 @@ class PredisStrategyTest extends PredisTestCase
     /**
      * Returns the list of expected supported commands.
      *
-     * @param  string $type Optional type of command (based on its keys)
+     * @param string $type Optional type of command (based on its keys)
+     *
      * @return array
      */
     protected function getExpectedCommands($type = null)

+ 2 - 1
tests/Predis/Cluster/RedisStrategyTest.php

@@ -257,7 +257,8 @@ class RedisStrategyTest extends PredisTestCase
     /**
      * Returns the list of expected supported commands.
      *
-     * @param  string $type Optional type of command (based on its keys)
+     * @param string $type Optional type of command (based on its keys)
+     *
      * @return array
      */
     protected function getExpectedCommands($type = null)

+ 2 - 2
tests/Predis/Collection/Iterator/HashKeyTest.php

@@ -21,7 +21,7 @@ class HashKeyTest extends PredisTestCase
 {
     /**
      * @group disconnected
-     * @expectedException Predis\NotSupportedException
+     * @expectedException \Predis\NotSupportedException
      * @expectedExceptionMessage The current profile does not support 'HSCAN'.
      */
     public function testThrowsExceptionOnInvalidProfile()
@@ -32,7 +32,7 @@ class HashKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new HashKey($client, 'key:hash');
+        new HashKey($client, 'key:hash');
     }
 
     /**

+ 2 - 2
tests/Predis/Collection/Iterator/KeyspaceTest.php

@@ -21,7 +21,7 @@ class KeyspaceTest extends PredisTestCase
 {
     /**
      * @group disconnected
-     * @expectedException Predis\NotSupportedException
+     * @expectedException \Predis\NotSupportedException
      * @expectedExceptionMessage The current profile does not support 'SCAN'.
      */
     public function testThrowsExceptionOnInvalidProfile()
@@ -32,7 +32,7 @@ class KeyspaceTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new Keyspace($client);
+        new Keyspace($client);
     }
 
     /**

+ 4 - 4
tests/Predis/Collection/Iterator/ListKeyTest.php

@@ -110,7 +110,7 @@ class ListKeyTest extends PredisTestCase
 
     /**
      * @group disconnected
-     * @expectedException InvalidArgumentException
+     * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage The $count argument must be a positive integer.
      */
     public function testThrowsExceptionOnConstructorWithNonIntegerCountParameter()
@@ -120,12 +120,12 @@ class ListKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::getDefault()));
 
-        $iterator = new ListKey($client, 'key:list', 'wrong');
+        new ListKey($client, 'key:list', 'wrong');
     }
 
     /**
      * @group disconnected
-     * @expectedException InvalidArgumentException
+     * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage The $count argument must be a positive integer.
      */
     public function testThrowsExceptionOnConstructorWithNegativeCountParameter()
@@ -135,7 +135,7 @@ class ListKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::getDefault()));
 
-        $iterator = new ListKey($client, 'key:list', 'wrong');
+        new ListKey($client, 'key:list', 'wrong');
     }
 
     /**

+ 2 - 2
tests/Predis/Collection/Iterator/SetKeyTest.php

@@ -21,7 +21,7 @@ class SetKeyTest extends PredisTestCase
 {
     /**
      * @group disconnected
-     * @expectedException Predis\NotSupportedException
+     * @expectedException \Predis\NotSupportedException
      * @expectedExceptionMessage The current profile does not support 'SSCAN'.
      */
     public function testThrowsExceptionOnInvalidProfile()
@@ -32,7 +32,7 @@ class SetKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new SetKey($client, 'key:set');
+        new SetKey($client, 'key:set');
     }
 
     /**

+ 2 - 2
tests/Predis/Collection/Iterator/SortedSetKeyTest.php

@@ -21,7 +21,7 @@ class SortedSetKeyTest extends PredisTestCase
 {
     /**
      * @group disconnected
-     * @expectedException Predis\NotSupportedException
+     * @expectedException \Predis\NotSupportedException
      * @expectedExceptionMessage The current profile does not support 'ZSCAN'.
      */
     public function testThrowsExceptionOnInvalidProfile()
@@ -32,7 +32,7 @@ class SortedSetKeyTest extends PredisTestCase
                ->method('getProfile')
                ->will($this->returnValue(Profile\Factory::get('2.0')));
 
-        $iterator = new SortedSetKey($client, 'key:zset');
+        new SortedSetKey($client, 'key:zset');
     }
 
     /**

+ 1 - 1
tests/Predis/Command/ConnectionSelectTest.php

@@ -70,7 +70,7 @@ class ConnectionSelectTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage ERR invalid DB index
      */
     public function testThrowsExceptionOnUnexpectedDatabase()

+ 1 - 1
tests/Predis/Command/HashDeleteTest.php

@@ -85,7 +85,7 @@ class HashDeleteTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashExistsTest.php

@@ -74,7 +74,7 @@ class HashExistsTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashGetAllTest.php

@@ -75,7 +75,7 @@ class HashGetAllTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashGetMultipleTest.php

@@ -91,7 +91,7 @@ class HashGetMultipleTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashGetTest.php

@@ -71,7 +71,7 @@ class HashGetTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 2 - 2
tests/Predis/Command/HashIncrementByFloatTest.php

@@ -83,7 +83,7 @@ class HashIncrementByFloatTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage ERR hash value is not a valid float
      */
     public function testThrowsExceptionOnStringField()
@@ -96,7 +96,7 @@ class HashIncrementByFloatTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 2 - 2
tests/Predis/Command/HashIncrementByTest.php

@@ -83,7 +83,7 @@ class HashIncrementByTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage ERR hash value is not an integer
      */
     public function testThrowsExceptionOnStringField()
@@ -96,7 +96,7 @@ class HashIncrementByTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashKeysTest.php

@@ -75,7 +75,7 @@ class HashKeysTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashLengthTest.php

@@ -70,7 +70,7 @@ class HashLengthTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashSetMultipleTest.php

@@ -97,7 +97,7 @@ class HashSetMultipleTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashSetPreserveTest.php

@@ -74,7 +74,7 @@ class HashSetPreserveTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashSetTest.php

@@ -73,7 +73,7 @@ class HashSetTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HashValuesTest.php

@@ -75,7 +75,7 @@ class HashValuesTest extends PredisCommandTestCase
 
     /**
      * @group connected
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 1 - 1
tests/Predis/Command/HyperLogLogAddTest.php

@@ -76,7 +76,7 @@ class HyperLogLogAddTest extends PredisCommandTestCase
     /**
      * @group connected
      * @requiresRedisVersion >= 2.8.9
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()

+ 2 - 2
tests/Predis/Command/HyperLogLogCountTest.php

@@ -77,7 +77,7 @@ class HyperLogLogCountTest extends PredisCommandTestCase
     /**
      * @group connected
      * @requiresRedisVersion >= 2.8.9
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongType()
@@ -91,7 +91,7 @@ class HyperLogLogCountTest extends PredisCommandTestCase
     /**
      * @group connected
      * @requiresRedisVersion >= 2.8.9
-     * @expectedException Predis\Response\ServerException
+     * @expectedException \Predis\Response\ServerException
      * @expectedExceptionMessage Operation against a key holding the wrong kind of value
      */
     public function testThrowsExceptionOnWrongTypeOfAtLeastOneKey()

部分文件因为文件数量过多而无法显示