Browse Source

Run php-cs against codebase.

Daniele Alessandri 11 years ago
parent
commit
02e43143d3
77 changed files with 248 additions and 258 deletions
  1. 1 1
      lib/Predis/BasicClientInterface.php
  2. 24 23
      lib/Predis/Client.php
  3. 2 2
      lib/Predis/ClientInterface.php
  4. 2 2
      lib/Predis/Cluster/Distributor/DistributorInterface.php
  5. 13 13
      lib/Predis/Cluster/Distributor/HashRing.php
  6. 1 1
      lib/Predis/Cluster/Hash/HashGeneratorInterface.php
  7. 11 10
      lib/Predis/Cluster/PredisStrategy.php
  8. 7 6
      lib/Predis/Cluster/RedisStrategy.php
  9. 2 2
      lib/Predis/Cluster/StrategyInterface.php
  10. 4 4
      lib/Predis/Collection/Iterator/CursorBasedIterator.php
  11. 2 2
      lib/Predis/Collection/Iterator/ListKey.php
  12. 5 5
      lib/Predis/Command/Command.php
  13. 1 1
      lib/Predis/Command/CommandInterface.php
  14. 1 1
      lib/Predis/Command/HashScan.php
  15. 1 1
      lib/Predis/Command/KeyScan.php
  16. 11 10
      lib/Predis/Command/Processor/KeyPrefixProcessor.php
  17. 2 2
      lib/Predis/Command/RawCommand.php
  18. 1 1
      lib/Predis/Command/ScriptCommand.php
  19. 1 1
      lib/Predis/Command/ServerClient.php
  20. 2 2
      lib/Predis/Command/ServerInfo.php
  21. 1 1
      lib/Predis/Command/SetScan.php
  22. 1 1
      lib/Predis/Command/ZSetAdd.php
  23. 2 1
      lib/Predis/Command/ZSetRange.php
  24. 1 1
      lib/Predis/Command/ZSetScan.php
  25. 1 1
      lib/Predis/Command/ZSetUnionStore.php
  26. 4 4
      lib/Predis/CommunicationException.php
  27. 2 2
      lib/Predis/Configuration/ClusterOption.php
  28. 1 1
      lib/Predis/Configuration/ConnectionFactoryOption.php
  29. 2 2
      lib/Predis/Configuration/OptionInterface.php
  30. 1 0
      lib/Predis/Configuration/Options.php
  31. 4 4
      lib/Predis/Configuration/OptionsInterface.php
  32. 1 1
      lib/Predis/Configuration/ProfileOption.php
  33. 3 3
      lib/Predis/Connection/AbstractConnection.php
  34. 4 4
      lib/Predis/Connection/AggregateConnectionInterface.php
  35. 0 2
      lib/Predis/Connection/ComposableConnectionInterface.php
  36. 2 2
      lib/Predis/Connection/ComposableStreamConnection.php
  37. 2 2
      lib/Predis/Connection/ConnectionInterface.php
  38. 1 1
      lib/Predis/Connection/Factory.php
  39. 5 5
      lib/Predis/Connection/FactoryInterface.php
  40. 6 6
      lib/Predis/Connection/Parameters.php
  41. 2 2
      lib/Predis/Connection/ParametersInterface.php
  42. 3 3
      lib/Predis/Connection/PhpiredisSocketConnection.php
  43. 4 4
      lib/Predis/Connection/PredisCluster.php
  44. 12 12
      lib/Predis/Connection/RedisCluster.php
  45. 7 7
      lib/Predis/Connection/StreamConnection.php
  46. 5 5
      lib/Predis/Connection/WebdisConnection.php
  47. 1 1
      lib/Predis/ExecutableContextInterface.php
  48. 1 1
      lib/Predis/Pipeline/Atomic.php
  49. 1 1
      lib/Predis/Pipeline/ConnectionErrorProof.php
  50. 9 9
      lib/Predis/Pipeline/Pipeline.php
  51. 1 1
      lib/Predis/Profile/Factory.php
  52. 4 4
      lib/Predis/Profile/ProfileInterface.php
  53. 3 3
      lib/Predis/Profile/RedisProfile.php
  54. 0 1
      lib/Predis/Profile/RedisVersion200.php
  55. 0 2
      lib/Predis/Profile/RedisVersion220.php
  56. 0 3
      lib/Predis/Profile/RedisVersion240.php
  57. 0 4
      lib/Predis/Profile/RedisVersion260.php
  58. 0 5
      lib/Predis/Profile/RedisVersion280.php
  59. 2 2
      lib/Predis/Protocol/ProtocolProcessorInterface.php
  60. 1 1
      lib/Predis/Protocol/RequestSerializerInterface.php
  61. 1 1
      lib/Predis/Protocol/ResponseReaderInterface.php
  62. 1 1
      lib/Predis/Protocol/Text/ComposableProtocolProcessor.php
  63. 3 3
      lib/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php
  64. 6 5
      lib/Predis/Protocol/Text/ProtocolProcessor.php
  65. 3 3
      lib/Predis/Protocol/Text/ResponseReader.php
  66. 7 7
      lib/Predis/PubSub/AbstractConsumer.php
  67. 2 2
      lib/Predis/PubSub/Consumer.php
  68. 2 2
      lib/Predis/PubSub/DispatcherLoop.php
  69. 7 6
      lib/Predis/Replication/ReplicationStrategy.php
  70. 1 0
      lib/Predis/Response/Error.php
  71. 1 1
      lib/Predis/Response/Iterator/MultiBulk.php
  72. 1 1
      lib/Predis/Response/Iterator/MultiBulkIterator.php
  73. 2 0
      lib/Predis/Response/Status.php
  74. 2 5
      lib/Predis/Session/Handler.php
  75. 2 2
      lib/Predis/Transaction/AbortedMultiExecException.php
  76. 12 13
      lib/Predis/Transaction/MultiExec.php
  77. 1 1
      lib/Predis/Transaction/MultiExecState.php

+ 1 - 1
lib/Predis/BasicClientInterface.php

@@ -24,7 +24,7 @@ interface BasicClientInterface
     /**
      * Executes the specified Redis command.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return mixed
      */
     public function executeCommand(CommandInterface $command);

+ 24 - 23
lib/Predis/Client.php

@@ -48,7 +48,7 @@ class Client implements ClientInterface
 
     /**
      * @param mixed $parameters Connection parameters for one or more servers.
-     * @param mixed $options Options to configure some behaviours of the client.
+     * @param mixed $options    Options to configure some behaviours of the client.
      */
     public function __construct($parameters = null, $options = null)
     {
@@ -62,7 +62,7 @@ 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)
@@ -91,7 +91,7 @@ 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)
@@ -141,7 +141,7 @@ 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 mixed
      */
     protected function getConnectionInitializerWrapper($callable)
@@ -240,7 +240,7 @@ 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 SingleConnectionInterface
      */
     public function getConnectionById($connectionID)
@@ -262,8 +262,8 @@ 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)
@@ -288,8 +288,8 @@ class Client implements 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 $commandID Command ID.
+     * @param  array  $arguments Arguments for the command.
      * @return mixed
      */
     public function __call($commandID, $arguments)
@@ -329,8 +329,8 @@ 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
      */
     protected function onErrorResponse(
@@ -363,8 +363,8 @@ 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)
@@ -380,6 +380,7 @@ class Client implements ClientInterface
 
             case 2:
                 list($arg0, $arg1) = $argv;
+
                 return $this->$initializer($arg0, $arg1);
 
             default:
@@ -391,7 +392,7 @@ 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 $arg,... Options for the context, or a callable, or both.
+     * @param  mixed          $arg,... Options for the context, or a callable, or both.
      * @return Pipeline|array
      */
     public function pipeline(/* arguments */)
@@ -402,15 +403,15 @@ 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)
     {
         if (isset($options['atomic']) && $options['atomic']) {
             $class = 'Predis\Pipeline\Atomic';
-        } else if (isset($options['fire-and-forget']) && $options['fire-and-forget']) {
+        } elseif (isset($options['fire-and-forget']) && $options['fire-and-forget']) {
             $class = 'Predis\Pipeline\FireAndForget';
         } else {
             $class = 'Predis\Pipeline\Pipeline';
@@ -429,7 +430,7 @@ 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 $arg,... Options for the context, or a callable, or both.
+     * @param  mixed                      $arg,... Options for the context, or a callable, or both.
      * @return TransactionMultiExec|array
      */
     public function transaction(/* arguments */)
@@ -440,8 +441,8 @@ 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 TransactionMultiExec|array
      */
     protected function createTransaction(array $options = null, $callable = null)
@@ -459,7 +460,7 @@ 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 $arg,... Options for the context, or a callable, or both.
+     * @param  mixed               $arg,... Options for the context, or a callable, or both.
      * @return PubSubConsumer|NULL
      */
     public function pubSubLoop(/* arguments */)
@@ -470,8 +471,8 @@ 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)

+ 2 - 2
lib/Predis/ClientInterface.php

@@ -58,8 +58,8 @@ interface ClientInterface extends BasicClientInterface
     /**
      * 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());

+ 2 - 2
lib/Predis/Cluster/Distributor/DistributorInterface.php

@@ -24,8 +24,8 @@ interface DistributorInterface
     /**
      * Adds a node to the distributor with an optional weight.
      *
-     * @param mixed $node Node object.
-     * @param int $weight Weight for the node.
+     * @param mixed $node   Node object.
+     * @param int   $weight Weight for the node.
      */
     public function add($node, $weight = null);
 

+ 13 - 13
lib/Predis/Cluster/Distributor/HashRing.php

@@ -34,7 +34,7 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
     private $nodes = array();
 
     /**
-     * @param int $replicas Number of replicas in the ring.
+     * @param int   $replicas         Number of replicas in the ring.
      * @param mixed $nodeHashCallback Callback returning a string used to calculate the hash of nodes.
      */
     public function __construct($replicas = self::DEFAULT_REPLICAS, $nodeHashCallback = null)
@@ -46,8 +46,8 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
     /**
      * Adds a node to the ring with an optional weight.
      *
-     * @param mixed $node Node object.
-     * @param int $weight Weight for the node.
+     * @param mixed $node   Node object.
+     * @param int   $weight Weight for the node.
      */
     public function add($node, $weight = null)
     {
@@ -148,10 +148,10 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
     /**
      * Implements the logic needed to add a node to the hashring.
      *
-     * @param array $ring Source hashring.
-     * @param mixed $node Node object to be added.
-     * @param int $totalNodes Total number of nodes.
-     * @param int $replicas Number of replicas in the ring.
+     * @param array $ring        Source hashring.
+     * @param mixed $node        Node object to be added.
+     * @param int   $totalNodes  Total number of nodes.
+     * @param int   $replicas    Number of replicas in the ring.
      * @param float $weightRatio Weight ratio for the node.
      */
     protected function addNodeToRing(&$ring, $node, $totalNodes, $replicas, $weightRatio)
@@ -181,7 +181,7 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
     /**
      * Calculates the hash for the specified value.
      *
-     * @param string $value Input value.
+     * @param  string $value Input value.
      * @return int
      */
     public function hash($value)
@@ -200,7 +200,7 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
     /**
      * Calculates the corrisponding key of a node distributed in the hashring.
      *
-     * @param int $key Computed hash of a key.
+     * @param  int $key Computed hash of a key.
      * @return int
      */
     private function getNodeKey($key)
@@ -216,7 +216,7 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
 
             if ($item > $key) {
                 $upper = $index - 1;
-            } else if ($item < $key) {
+            } elseif ($item < $key) {
                 $lower = $index + 1;
             } else {
                 return $item;
@@ -229,9 +229,9 @@ 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)

+ 1 - 1
lib/Predis/Cluster/Hash/HashGeneratorInterface.php

@@ -22,7 +22,7 @@ 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);

+ 11 - 10
lib/Predis/Cluster/PredisStrategy.php

@@ -180,7 +180,7 @@ class PredisStrategy implements StrategyInterface
      * handler for the specified command ID is removed.
      *
      * @param string $commandID Command ID.
-     * @param mixed $callback A valid callable object, or NULL to unset the handler.
+     * @param mixed  $callback  A valid callable object, or NULL to unset the handler.
      */
     public function setCommandHandler($commandID, $callback = null)
     {
@@ -188,6 +188,7 @@ class PredisStrategy implements StrategyInterface
 
         if (!isset($callback)) {
             unset($this->commands[$commandID]);
+
             return;
         }
 
@@ -203,7 +204,7 @@ class PredisStrategy 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)
@@ -215,7 +216,7 @@ class PredisStrategy 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)
@@ -231,7 +232,7 @@ class PredisStrategy 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 getKeyFromInterleavedArguments(CommandInterface $command)
@@ -251,7 +252,7 @@ class PredisStrategy implements StrategyInterface
     /**
      * 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)
@@ -266,7 +267,7 @@ class PredisStrategy implements StrategyInterface
     /**
      * Extracts the key from BITOP command.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return string
      */
     protected function getKeyFromBitOp(CommandInterface $command)
@@ -281,7 +282,7 @@ class PredisStrategy implements StrategyInterface
     /**
      * 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)
@@ -297,7 +298,7 @@ class PredisStrategy implements StrategyInterface
     /**
      * 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)
@@ -346,7 +347,7 @@ class PredisStrategy 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 Boolean
      */
     protected function checkSameHashForKeys(array $keys)
@@ -374,7 +375,7 @@ class PredisStrategy 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)

+ 7 - 6
lib/Predis/Cluster/RedisStrategy.php

@@ -165,7 +165,7 @@ class RedisStrategy implements StrategyInterface
      * handler for the specified command ID is removed.
      *
      * @param string $commandID Command ID.
-     * @param mixed $callback A valid callable object, or NULL to unset the handler.
+     * @param mixed  $callback  A valid callable object, or NULL to unset the handler.
      */
     public function setCommandHandler($commandID, $callback = null)
     {
@@ -173,6 +173,7 @@ class RedisStrategy implements StrategyInterface
 
         if (!isset($callback)) {
             unset($this->commands[$commandID]);
+
             return;
         }
 
@@ -188,7 +189,7 @@ class RedisStrategy 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)
@@ -200,7 +201,7 @@ class RedisStrategy implements StrategyInterface
      * Extracts the key from a command that can accept multiple keys ensuring
      * that only one key is actually specified to comply with redis-cluster.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return string
      */
     protected function getKeyFromAllArguments(CommandInterface $command)
@@ -216,7 +217,7 @@ class RedisStrategy implements StrategyInterface
      * Extracts the key from a command that can accept multiple keys ensuring
      * that only one key is actually specified to comply with redis-cluster.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return string
      */
     protected function getKeyFromInterleavedArguments(CommandInterface $command)
@@ -232,7 +233,7 @@ class RedisStrategy implements StrategyInterface
      * Extracts the key from BLPOP and BRPOP commands ensuring that only one key
      * is actually specified to comply with redis-cluster.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return string
      */
     protected function getKeyFromBlockingListCommands(CommandInterface $command)
@@ -247,7 +248,7 @@ class RedisStrategy implements StrategyInterface
     /**
      * 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)

+ 2 - 2
lib/Predis/Cluster/StrategyInterface.php

@@ -27,7 +27,7 @@ interface StrategyInterface
      * Returns the hash for the given command using the specified algorithm, or
      * null when the command cannot be hashed.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return int
      */
     public function getHash(CommandInterface $command);
@@ -35,7 +35,7 @@ interface StrategyInterface
     /**
      * Returns the hash for the given key using the specified algorithm.
      *
-     * @param string $key Key string.
+     * @param  string $key Key string.
      * @return string
      */
     public function getKeyHash($key);

+ 4 - 4
lib/Predis/Collection/Iterator/CursorBasedIterator.php

@@ -43,8 +43,8 @@ abstract class CursorBasedIterator implements Iterator
 
     /**
      * @param ClientInterface $client Client connected to Redis.
-     * @param string $match Pattern to match during the server-side iteration.
-     * @param int $count Hint used by Redis to compute the number of results per iteration.
+     * @param string          $match  Pattern to match during the server-side iteration.
+     * @param int             $count  Hint used by Redis to compute the number of results per iteration.
      */
     public function __construct(ClientInterface $client, $match = null, $count = null)
     {
@@ -108,7 +108,7 @@ abstract class CursorBasedIterator implements Iterator
      *
      * @return array
      */
-    protected abstract function executeCommand();
+    abstract protected function executeCommand();
 
     /**
      * Populates the local buffer of elements fetched from the server during
@@ -171,7 +171,7 @@ abstract class CursorBasedIterator implements Iterator
 
         if ($this->elements) {
             $this->extractNext();
-        } else if ($this->cursor) {
+        } elseif ($this->cursor) {
             $this->next();
         } else {
             $this->valid = false;

+ 2 - 2
lib/Predis/Collection/Iterator/ListKey.php

@@ -43,8 +43,8 @@ class ListKey implements Iterator
 
     /**
      * @param ClientInterface $client Client connected to Redis.
-     * @param string $key Redis list key.
-     * @param int $count Number of items retrieved on each fetch operation.
+     * @param string          $key    Redis list key.
+     * @param int             $count  Number of items retrieved on each fetch operation.
      */
     public function __construct(ClientInterface $client, $key, $count = 10)
     {

+ 5 - 5
lib/Predis/Command/Command.php

@@ -24,7 +24,7 @@ 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)
@@ -99,8 +99,8 @@ abstract class Command implements CommandInterface
     /**
      * Helper function used to reduce a list of arguments to a string.
      *
-     * @param string $accumulator Temporary string.
-     * @param string $argument Current argument.
+     * @param  string $accumulator Temporary string.
+     * @param  string $argument    Current argument.
      * @return string
      */
     protected function toStringArgumentReducer($accumulator, $argument)
@@ -131,7 +131,7 @@ 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)
@@ -146,7 +146,7 @@ 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)

+ 1 - 1
lib/Predis/Command/CommandInterface.php

@@ -71,7 +71,7 @@ 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);

+ 1 - 1
lib/Predis/Command/HashScan.php

@@ -41,7 +41,7 @@ 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)

+ 1 - 1
lib/Predis/Command/KeyScan.php

@@ -41,7 +41,7 @@ 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)

+ 11 - 10
lib/Predis/Command/Processor/KeyPrefixProcessor.php

@@ -179,7 +179,7 @@ class KeyPrefixProcessor implements ProcessorInterface
     {
         if ($command instanceof PrefixableCommandInterface) {
             $command->prefixKeys($this->prefix);
-        } else if (isset($this->commands[$commandID = strtoupper($command->getId())])) {
+        } elseif (isset($this->commands[$commandID = strtoupper($command->getId())])) {
             call_user_func($this->commands[$commandID], $command, $this->prefix);
         }
     }
@@ -196,7 +196,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * associated handler for the specified command ID is removed.
      *
      * @param string $commandID The ID of the command to be handled.
-     * @param mixed $callback A valid callable object or NULL.
+     * @param mixed  $callback  A valid callable object or NULL.
      */
     public function setCommandHandler($commandID, $callback = null)
     {
@@ -204,6 +204,7 @@ class KeyPrefixProcessor implements ProcessorInterface
 
         if (!isset($callback)) {
             unset($this->commands[$commandID]);
+
             return;
         }
 
@@ -228,7 +229,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix only the first argument.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function first(CommandInterface $command, $prefix)
     {
@@ -242,7 +243,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix to all the arguments.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function all(CommandInterface $command, $prefix)
     {
@@ -259,7 +260,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix only to even arguments in the list.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function interleaved(CommandInterface $command, $prefix)
     {
@@ -278,7 +279,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix to all the arguments but the first one.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function skipFirst(CommandInterface $command, $prefix)
     {
@@ -297,7 +298,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix to all the arguments but the last one.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function skipLast(CommandInterface $command, $prefix)
     {
@@ -316,7 +317,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix to the keys of a SORT command.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function sort(CommandInterface $command, $prefix)
     {
@@ -353,7 +354,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix to the keys of an EVAL-based command.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function evalKeys(CommandInterface $command, $prefix)
     {
@@ -370,7 +371,7 @@ class KeyPrefixProcessor implements ProcessorInterface
      * Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE.
      *
      * @param CommandInterface $command Command instance.
-     * @param string $prefix Prefix string.
+     * @param string           $prefix  Prefix string.
      */
     public static function zsetStore(CommandInterface $command, $prefix)
     {

+ 2 - 2
lib/Predis/Command/RawCommand.php

@@ -129,8 +129,8 @@ class RawCommand implements CommandInterface
     /**
      * Helper function used to reduce a list of arguments to a string.
      *
-     * @param string $accumulator Temporary string.
-     * @param string $argument Current argument.
+     * @param  string $accumulator Temporary string.
+     * @param  string $argument    Current argument.
      * @return string
      */
     protected function toStringArgumentReducer($accumulator, $argument)

+ 1 - 1
lib/Predis/Command/ScriptCommand.php

@@ -25,7 +25,7 @@ abstract class ScriptCommand extends ServerEvalSHA
      *
      * @return string
      */
-    public abstract function getScript();
+    abstract public function getScript();
 
     /**
      * Specifies the number of arguments that should be considered as keys.

+ 1 - 1
lib/Predis/Command/ServerClient.php

@@ -49,7 +49,7 @@ 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)

+ 2 - 2
lib/Predis/Command/ServerInfo.php

@@ -58,7 +58,7 @@ 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)
@@ -76,7 +76,7 @@ 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)

+ 1 - 1
lib/Predis/Command/SetScan.php

@@ -41,7 +41,7 @@ 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)

+ 1 - 1
lib/Predis/Command/ZSetAdd.php

@@ -33,7 +33,7 @@ class ZSetAdd extends Command
         if (count($arguments) === 2 && is_array($arguments[1])) {
             $flattened = array($arguments[0]);
 
-            foreach($arguments[1] as $member => $score) {
+            foreach ($arguments[1] as $member => $score) {
                 $flattened[] = $score;
                 $flattened[] = $member;
             }

+ 2 - 1
lib/Predis/Command/ZSetRange.php

@@ -41,6 +41,7 @@ class ZSetRange extends Command
 
             if ($lastType === 'array') {
                 $options = $this->prepareOptions(array_pop($arguments));
+
                 return array_merge($arguments, $options);
             }
         }
@@ -51,7 +52,7 @@ 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)

+ 1 - 1
lib/Predis/Command/ZSetScan.php

@@ -41,7 +41,7 @@ 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)

+ 1 - 1
lib/Predis/Command/ZSetUnionStore.php

@@ -50,7 +50,7 @@ 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)

+ 4 - 4
lib/Predis/CommunicationException.php

@@ -23,10 +23,10 @@ abstract class CommunicationException extends PredisException
     private $connection;
 
     /**
-     * @param SingleConnectionInterface $connection Connection that generated the exception.
-     * @param string $message Error message.
-     * @param int $code Error code.
-     * @param \Exception $innerException Inner exception for wrapping the original error.
+     * @param SingleConnectionInterface $connection     Connection that generated the exception.
+     * @param string                    $message        Error message.
+     * @param int                       $code           Error code.
+     * @param \Exception                $innerException Inner exception for wrapping the original error.
      */
     public function __construct(
         SingleConnectionInterface $connection,

+ 2 - 2
lib/Predis/Configuration/ClusterOption.php

@@ -28,8 +28,8 @@ 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 ClusterConnectionInterface
      */
     protected function createByDescription(OptionsInterface $options, $id)

+ 1 - 1
lib/Predis/Configuration/ConnectionFactoryOption.php

@@ -30,7 +30,7 @@ class ConnectionFactoryOption implements OptionInterface
     {
         if ($value instanceof FactoryInterface) {
             return $value;
-        } else if (is_array($value)) {
+        } elseif (is_array($value)) {
             $factory = $this->getDefault($options);
 
             foreach ($value as $scheme => $initializer) {

+ 2 - 2
lib/Predis/Configuration/OptionInterface.php

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

+ 1 - 0
lib/Predis/Configuration/Options.php

@@ -58,6 +58,7 @@ class Options implements OptionsInterface
         if (isset($this->handlers[$option])) {
             $handler = $this->handlers[$option];
             $handler = new $handler();
+
             return $handler->getDefault($this);
         }
     }

+ 4 - 4
lib/Predis/Configuration/OptionsInterface.php

@@ -21,7 +21,7 @@ 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);
@@ -29,7 +29,7 @@ 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);
@@ -37,7 +37,7 @@ 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);
@@ -45,7 +45,7 @@ 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);

+ 1 - 1
lib/Predis/Configuration/ProfileOption.php

@@ -45,7 +45,7 @@ class ProfileOption implements OptionInterface
         if (is_string($value)) {
             $value = Factory::get($value);
             $this->setProcessors($options, $value);
-        } else if (!$value instanceof ProfileInterface) {
+        } elseif (!$value instanceof ProfileInterface) {
             throw new InvalidArgumentException('Invalid value for the profile option.');
         }
 

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

@@ -14,7 +14,6 @@ namespace Predis\Connection;
 use InvalidArgumentException;
 use Predis\ClientException;
 use Predis\CommunicationException;
-use Predis\NotSupportedException;
 use Predis\Command\CommandInterface;
 use Predis\Protocol\ProtocolException;
 
@@ -74,7 +73,7 @@ abstract class AbstractConnection implements SingleConnectionInterface
      *
      * @return mixed
      */
-    protected abstract function createResource();
+    abstract protected function createResource();
 
     /**
      * {@inheritdoc}
@@ -118,6 +117,7 @@ abstract class AbstractConnection implements SingleConnectionInterface
     public function executeCommand(CommandInterface $command)
     {
         $this->writeRequest($command);
+
         return $this->readResponse($command);
     }
 
@@ -133,7 +133,7 @@ abstract class AbstractConnection implements SingleConnectionInterface
      * Helper method to handle connection errors.
      *
      * @param string $message Error message.
-     * @param int $code Error code.
+     * @param int    $code    Error code.
      */
     protected function onConnectionError($message, $code = null)
     {

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

@@ -31,15 +31,15 @@ interface AggregateConnectionInterface extends ConnectionInterface
     /**
      * Removes the specified connection instance from the aggregate connection.
      *
-     * @param SingleConnectionInterface $connection Connection instance.
-     * @return bool Returns true if the connection was in the pool.
+     * @param  SingleConnectionInterface $connection Connection instance.
+     * @return bool                      Returns true if the connection was in the pool.
      */
     public function remove(SingleConnectionInterface $connection);
 
     /**
      * Returns the connection instance in charge for the given command.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface          $command Command instance.
      * @return SingleConnectionInterface
      */
     public function getConnection(CommandInterface $command);
@@ -47,7 +47,7 @@ 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 SingleConnectionInterface
      */
     public function getConnectionById($connectionID);

+ 0 - 2
lib/Predis/Connection/ComposableConnectionInterface.php

@@ -11,8 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\Protocol\ProtocolInterface;
-
 /**
  * Defines a connection to communicate with a single Redis server that leverages
  * an external protocol processor to handle pluggable protocol handlers.

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

@@ -26,8 +26,8 @@ class ComposableStreamConnection extends StreamConnection implements ComposableC
     protected $protocol;
 
     /**
-     * @param ParametersInterface $parameters Initialization parameters for the connection.
-     * @param ProtocolProcessorInterface $protocol Protocol processor.
+     * @param ParametersInterface        $parameters Initialization parameters for the connection.
+     * @param ProtocolProcessorInterface $protocol   Protocol processor.
      */
     public function __construct(
         ParametersInterface $parameters,

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

@@ -48,7 +48,7 @@ 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 +57,7 @@ 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);

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

@@ -33,7 +33,7 @@ class Factory implements FactoryInterface
      * implementing Predis\Connection\SingleConnectionInterface. 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)

+ 5 - 5
lib/Predis/Connection/FactoryInterface.php

@@ -21,8 +21,8 @@ interface FactoryInterface
     /**
      * Defines or overrides the connection class identified by a scheme prefix.
      *
-     * @param string $scheme Target connection scheme.
-     * @param mixed $initializer Fully-qualified name of a class or a callable for lazy initialization.
+     * @param string $scheme      Target connection scheme.
+     * @param mixed  $initializer Fully-qualified name of a class or a callable for lazy initialization.
      */
     public function define($scheme, $initializer);
 
@@ -36,7 +36,7 @@ interface FactoryInterface
     /**
      * Creates a new connection object.
      *
-     * @param mixed $parameters Initialization parameters for the connection.
+     * @param  mixed                     $parameters Initialization parameters for the connection.
      * @return SingleConnectionInterface
      */
     public function create($parameters);
@@ -44,8 +44,8 @@ interface FactoryInterface
     /**
      * Aggregates single connections into an aggregate connection instance.
      *
-     * @param AggregateConnectionInterface $aggregate Aggregate connection instance.
-     * @param array $parameters List of parameters for each connection.
+     * @param AggregateConnectionInterface $aggregate  Aggregate connection instance.
+     * @param array                        $parameters List of parameters for each connection.
      */
     public function aggregate(AggregateConnectionInterface $aggregate, array $parameters);
 }

+ 6 - 6
lib/Predis/Connection/Parameters.php

@@ -69,7 +69,7 @@ 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)
@@ -84,7 +84,7 @@ 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)
@@ -111,7 +111,7 @@ 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
      */
     private function filter(array $parameters)
@@ -130,7 +130,7 @@ class Parameters implements ParametersInterface
     /**
      * Validates value as boolean.
      *
-     * @param mixed $value Input value.
+     * @param  mixed   $value Input value.
      * @return boolean
      */
     private static function castBoolean($value)
@@ -141,7 +141,7 @@ class Parameters implements ParametersInterface
     /**
      * Validates value as float.
      *
-     * @param mixed $value Input value.
+     * @param  mixed $value Input value.
      * @return float
      */
     private static function castFloat($value)
@@ -152,7 +152,7 @@ class Parameters implements ParametersInterface
     /**
      * Validates value as integer.
      *
-     * @param mixed $value Input value.
+     * @param  mixed $value Input value.
      * @return int
      */
     private static function castInteger($value)

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

@@ -21,7 +21,7 @@ interface ParametersInterface
     /**
      * Checks if the specified parameters is set.
      *
-     * @param string $property Name of the property.
+     * @param  string  $property Name of the property.
      * @return Boolean
      */
     public function __isset($parameter);
@@ -29,7 +29,7 @@ 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);

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

@@ -186,7 +186,7 @@ class PhpiredisSocketConnection extends AbstractConnection
     /**
      * Sets options on the socket resource from the connection parameters.
      *
-     * @param resource $socket Socket resource.
+     * @param resource            $socket     Socket resource.
      * @param ParametersInterface $parameters Parameters used to initialize the connection.
      */
     private function setSocketOptions($socket, ParametersInterface $parameters)
@@ -226,7 +226,7 @@ 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
      */
     private static function getAddress(ParametersInterface $parameters)
@@ -251,7 +251,7 @@ 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)

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

@@ -114,8 +114,8 @@ class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Co
     /**
      * 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)
     {
@@ -155,7 +155,7 @@ class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Co
     /**
      * Retrieves a connection instance from the cluster using a key.
      *
-     * @param string $key Key string.
+     * @param  string                    $key Key string.
      * @return SingleConnectionInterface
      */
     public function getConnectionByKey($key)
@@ -220,7 +220,7 @@ class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Co
     /**
      * 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)

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

@@ -126,8 +126,8 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * 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)
     {
@@ -213,8 +213,8 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Pre-associates a connection to a slots range to avoid runtime guessing.
      *
-     * @param int $first Initial slot of the range.
-     * @param int $last Last slot of the range.
+     * @param int                              $first      Initial slot of the range.
+     * @param int                              $last       Last slot of the range.
      * @param SingleConnectionInterface|string $connection ID or connection instance.
      */
     public function setSlots($first, $last, $connection)
@@ -237,7 +237,7 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
      * 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)
@@ -282,7 +282,7 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Returns the connection currently associated to a given slot.
      *
-     * @param int $slot Slot index.
+     * @param  int                       $slot Slot index.
      * @return SingleConnectionInterface
      */
     public function getConnectionBySlot($slot)
@@ -338,7 +338,7 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
      * The connection is added to the connections pool if not yet included.
      *
      * @param SingleConnectionInterface $connection Connection instance.
-     * @param int $slot Target slot index.
+     * @param int                       $slot       Target slot index.
      */
     protected function move(SingleConnectionInterface $connection, $slot)
     {
@@ -349,8 +349,8 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Handles -ERR responses from 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)
@@ -371,9 +371,9 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
      * Handles -MOVED and -ASK responses by re-executing the command on the node
      * specified by the Redis response.
      *
-     * @param CommandInterface $command Command that generated the -MOVE or -ASK response.
-     * @param string $request Type of request (either 'MOVED' or 'ASK').
-     * @param string $details Parameters of the MOVED/ASK request.
+     * @param  CommandInterface $command Command that generated the -MOVE or -ASK response.
+     * @param  string           $request Type of request (either 'MOVED' or 'ASK').
+     * @param  string           $details Parameters of the MOVED/ASK request.
      * @return mixed
      */
     protected function onMoveRequest(CommandInterface $command, $request, $details)

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

@@ -61,7 +61,7 @@ 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
      */
     private function tcpStreamInitializer(ParametersInterface $parameters)
@@ -103,7 +103,7 @@ 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
      */
     private function unixStreamInitializer(ParametersInterface $parameters)
@@ -190,10 +190,10 @@ class StreamConnection extends AbstractConnection
         $payload = substr($chunk, 1, -2);
 
         switch ($prefix) {
-            case '+':    // inline
+            case '+':
                 return StatusResponse::get($payload);
 
-            case '$':    // bulk
+            case '$':
                 $size = (int) $payload;
 
                 if ($size === -1) {
@@ -216,7 +216,7 @@ class StreamConnection extends AbstractConnection
 
                 return substr($bulkData, 0, -2);
 
-            case '*':    // multi bulk
+            case '*':
                 $count = (int) $payload;
 
                 if ($count === -1) {
@@ -231,10 +231,10 @@ class StreamConnection extends AbstractConnection
 
                 return $multibulk;
 
-            case ':':    // integer
+            case ':':
                 return (int) $payload;
 
-            case '-':    // error
+            case '-':
                 return new ErrorResponse($payload);
 
             default:

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

@@ -106,7 +106,7 @@ class WebdisConnection implements SingleConnectionInterface
     /**
      * Initializes cURL.
      *
-     * @param ParametersInterface $parameters Initialization parameters for the connection.
+     * @param  ParametersInterface $parameters Initialization parameters for the connection.
      * @return resource
      */
     private function createCurl(ParametersInterface $parameters)
@@ -132,7 +132,7 @@ class WebdisConnection implements SingleConnectionInterface
     /**
      * Initializes the phpiredis protocol reader.
      *
-     * @param ParametersInterface $parameters Initialization parameters for the connection.
+     * @param  ParametersInterface $parameters Initialization parameters for the connection.
      * @return resource
      */
     private function createReader(ParametersInterface $parameters)
@@ -172,8 +172,8 @@ class WebdisConnection implements SingleConnectionInterface
     /**
      * 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)
@@ -210,7 +210,7 @@ class WebdisConnection implements SingleConnectionInterface
     /**
      * Checks if the specified command is supported by this connection class.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return string
      */
     protected function getCommandId(CommandInterface $command)

+ 1 - 1
lib/Predis/ExecutableContextInterface.php

@@ -22,7 +22,7 @@ interface ExecutableContextInterface
     /**
      * 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);

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

@@ -106,7 +106,7 @@ class Atomic extends Pipeline
 
             if (!$response instanceof ResponseInterface) {
                 $responses[] = $command->parseResponse($response);
-            } else if ($response instanceof ErrorResponseInterface && $exceptions) {
+            } elseif ($response instanceof ErrorResponseInterface && $exceptions) {
                 $this->exception($connection, $response);
             } else {
                 $responses[] = $response;

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

@@ -42,7 +42,7 @@ class ConnectionErrorProof extends Pipeline
     {
         if ($connection instanceof SingleConnectionInterface) {
             return $this->executeSingleNode($connection, $commands);
-        } else if ($connection instanceof ClusterConnectionInterface) {
+        } elseif ($connection instanceof ClusterConnectionInterface) {
             return $this->executeCluster($connection, $commands);
         } else {
             $class = get_class($connection);

+ 9 - 9
lib/Predis/Pipeline/Pipeline.php

@@ -51,8 +51,8 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
     /**
      * 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 Pipeline
      */
     public function __call($method, $arguments)
@@ -86,8 +86,8 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
     /**
      * Throws an exception on -ERR responses returned by Redis.
      *
-     * @param ConnectionInterface $connection Redis connection that returned the error.
-     * @param ErrorResponseInterface $response Instance of the error response.
+     * @param ConnectionInterface    $connection Redis connection that returned the error.
+     * @param ErrorResponseInterface $response   Instance of the error response.
      */
     protected function exception(ConnectionInterface $connection, ErrorResponseInterface $response)
     {
@@ -117,8 +117,8 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
      * 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)
@@ -136,7 +136,7 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
 
             if (!$response instanceof ResponseInterface) {
                 $responses[] = $command->parseResponse($response);
-            } else if ($response instanceof ErrorResponseInterface && $exceptions) {
+            } elseif ($response instanceof ErrorResponseInterface && $exceptions) {
                 $this->exception($connection, $response);
             } else {
                 $responses[] = $response;
@@ -149,7 +149,7 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
     /**
      * 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 Pipeline
      */
     public function flushPipeline($send = true)
@@ -181,7 +181,7 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
     /**
      * Handles the actual execution of the whole pipeline.
      *
-     * @param mixed $callable Optional callback for execution.
+     * @param  mixed $callable Optional callback for execution.
      * @return array
      */
     public function execute($callable = null)

+ 1 - 1
lib/Predis/Profile/Factory.php

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

+ 4 - 4
lib/Predis/Profile/ProfileInterface.php

@@ -32,7 +32,7 @@ interface ProfileInterface
     /**
      * Checks if the profile supports the specified command.
      *
-     * @param string $commandID Command ID.
+     * @param  string  $commandID Command ID.
      * @return Boolean
      */
     public function supportsCommand($commandID);
@@ -40,7 +40,7 @@ interface ProfileInterface
     /**
      * 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 +48,8 @@ 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());

+ 3 - 3
lib/Predis/Profile/RedisProfile.php

@@ -40,7 +40,7 @@ abstract class RedisProfile implements ProfileInterface
      *
      * @return array
      */
-    protected abstract function getSupportedCommands();
+    abstract protected function getSupportedCommands();
 
     /**
      * {@inheritdoc}
@@ -68,7 +68,7 @@ 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)
@@ -103,7 +103,7 @@ abstract class RedisProfile implements ProfileInterface
     /**
      * Defines a new command in the server profile.
      *
-     * @param string $commandID Command ID.
+     * @param string $commandID    Command ID.
      * @param string $commandClass Fully-qualified name of a Predis\Command\CommandInterface.
      */
     public function defineCommand($commandID, $class)

+ 0 - 1
lib/Predis/Profile/RedisVersion200.php

@@ -121,7 +121,6 @@ class RedisVersion200 extends RedisProfile
             'SHUTDOWN'                  => 'Predis\Command\ServerShutdown',
             'BGREWRITEAOF'              => 'Predis\Command\ServerBackgroundRewriteAOF',
 
-
             /* ---------------- Redis 2.0 ---------------- */
 
             /* commands operating on string values */

+ 0 - 2
lib/Predis/Profile/RedisVersion220.php

@@ -121,7 +121,6 @@ class RedisVersion220 extends RedisProfile
             'SHUTDOWN'                  => 'Predis\Command\ServerShutdown',
             'BGREWRITEAOF'              => 'Predis\Command\ServerBackgroundRewriteAOF',
 
-
             /* ---------------- Redis 2.0 ---------------- */
 
             /* commands operating on string values */
@@ -170,7 +169,6 @@ class RedisVersion220 extends RedisProfile
             /* remote server control commands */
             'CONFIG'                    => 'Predis\Command\ServerConfig',
 
-
             /* ---------------- Redis 2.2 ---------------- */
 
             /* commands operating on the key space */

+ 0 - 3
lib/Predis/Profile/RedisVersion240.php

@@ -121,7 +121,6 @@ class RedisVersion240 extends RedisProfile
             'SHUTDOWN'                  => 'Predis\Command\ServerShutdown',
             'BGREWRITEAOF'              => 'Predis\Command\ServerBackgroundRewriteAOF',
 
-
             /* ---------------- Redis 2.0 ---------------- */
 
             /* commands operating on string values */
@@ -170,7 +169,6 @@ class RedisVersion240 extends RedisProfile
             /* remote server control commands */
             'CONFIG'                    => 'Predis\Command\ServerConfig',
 
-
             /* ---------------- Redis 2.2 ---------------- */
 
             /* commands operating on the key space */
@@ -200,7 +198,6 @@ class RedisVersion240 extends RedisProfile
             'OBJECT'                    => 'Predis\Command\ServerObject',
             'SLOWLOG'                   => 'Predis\Command\ServerSlowlog',
 
-
             /* ---------------- Redis 2.4 ---------------- */
 
             /* remote server control commands */

+ 0 - 4
lib/Predis/Profile/RedisVersion260.php

@@ -123,7 +123,6 @@ class RedisVersion260 extends RedisProfile
             'SHUTDOWN'                  => 'Predis\Command\ServerShutdown',
             'BGREWRITEAOF'              => 'Predis\Command\ServerBackgroundRewriteAOF',
 
-
             /* ---------------- Redis 2.0 ---------------- */
 
             /* commands operating on string values */
@@ -172,7 +171,6 @@ class RedisVersion260 extends RedisProfile
             /* remote server control commands */
             'CONFIG'                    => 'Predis\Command\ServerConfig',
 
-
             /* ---------------- Redis 2.2 ---------------- */
 
             /* commands operating on the key space */
@@ -202,13 +200,11 @@ class RedisVersion260 extends RedisProfile
             'OBJECT'                    => 'Predis\Command\ServerObject',
             'SLOWLOG'                   => 'Predis\Command\ServerSlowlog',
 
-
             /* ---------------- Redis 2.4 ---------------- */
 
             /* remote server control commands */
             'CLIENT'                    => 'Predis\Command\ServerClient',
 
-
             /* ---------------- Redis 2.6 ---------------- */
 
             /* commands operating on the key space */

+ 0 - 5
lib/Predis/Profile/RedisVersion280.php

@@ -123,7 +123,6 @@ class RedisVersion280 extends RedisProfile
             'SHUTDOWN'                  => 'Predis\Command\ServerShutdown',
             'BGREWRITEAOF'              => 'Predis\Command\ServerBackgroundRewriteAOF',
 
-
             /* ---------------- Redis 2.0 ---------------- */
 
             /* commands operating on string values */
@@ -172,7 +171,6 @@ class RedisVersion280 extends RedisProfile
             /* remote server control commands */
             'CONFIG'                    => 'Predis\Command\ServerConfig',
 
-
             /* ---------------- Redis 2.2 ---------------- */
 
             /* commands operating on the key space */
@@ -202,13 +200,11 @@ class RedisVersion280 extends RedisProfile
             'OBJECT'                    => 'Predis\Command\ServerObject',
             'SLOWLOG'                   => 'Predis\Command\ServerSlowlog',
 
-
             /* ---------------- Redis 2.4 ---------------- */
 
             /* remote server control commands */
             'CLIENT'                    => 'Predis\Command\ServerClient',
 
-
             /* ---------------- Redis 2.6 ---------------- */
 
             /* commands operating on the key space */
@@ -235,7 +231,6 @@ class RedisVersion280 extends RedisProfile
             'TIME'                      => 'Predis\Command\ServerTime',
             'SENTINEL'                  => 'Predis\Command\ServerSentinel',
 
-
             /* ---------------- Redis 2.8 ---------------- */
 
             /* commands operating on the key space */

+ 2 - 2
lib/Predis/Protocol/ProtocolProcessorInterface.php

@@ -26,14 +26,14 @@ interface ProtocolProcessorInterface
      * Writes a request over a connection to Redis.
      *
      * @param ComposableConnectionInterface $connection Redis connection.
-     * @param CommandInterface $command Command instance.
+     * @param CommandInterface              $command    Command instance.
      */
     public function write(ComposableConnectionInterface $connection, CommandInterface $command);
 
     /**
      * Reads a response from a connection to Redis.
      *
-     * @param ComposableConnectionInterface $connection Redis connection.
+     * @param  ComposableConnectionInterface $connection Redis connection.
      * @return mixed
      */
     public function read(ComposableConnectionInterface $connection);

+ 1 - 1
lib/Predis/Protocol/RequestSerializerInterface.php

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

+ 1 - 1
lib/Predis/Protocol/ResponseReaderInterface.php

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

+ 1 - 1
lib/Predis/Protocol/Text/ComposableProtocolProcessor.php

@@ -31,7 +31,7 @@ class ComposableProtocolProcessor implements ProtocolProcessorInterface
 
     /**
      * @param RequestSerializerInterface $serializer Request serializer.
-     * @param ResponseReaderInterface $reader Response reader.
+     * @param ResponseReaderInterface    $reader     Response reader.
      */
     public function __construct(
         RequestSerializerInterface $serializer = null,

+ 3 - 3
lib/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php

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

+ 6 - 5
lib/Predis/Protocol/Text/ProtocolProcessor.php

@@ -59,17 +59,18 @@ class ProtocolProcessor implements ProtocolProcessorInterface
         $payload = substr($chunk, 1);
 
         switch ($prefix) {
-            case '+':    // inline
+            case '+':
                 return new StatusResponse($payload);
 
-            case '$':    // bulk
+            case '$':
                 $size = (int) $payload;
                 if ($size === -1) {
                     return null;
                 }
+
                 return substr($connection->readBuffer($size + 2), 0, -2);
 
-            case '*':    // multi bulk
+            case '*':
                 $count = (int) $payload;
 
                 if ($count === -1) {
@@ -87,10 +88,10 @@ class ProtocolProcessor implements ProtocolProcessorInterface
 
                 return $multibulk;
 
-            case ':':    // integer
+            case ':':
                 return (int) $payload;
 
-            case '-':    // error
+            case '-':
                 return new ErrorResponse($payload);
 
             default:

+ 3 - 3
lib/Predis/Protocol/Text/ResponseReader.php

@@ -53,7 +53,7 @@ class ResponseReader implements ResponseReaderInterface
     /**
      * Sets the handler for the specified prefix identifying the response type.
      *
-     * @param string $prefix Identifier of the type of response.
+     * @param string                           $prefix  Identifier of the type of response.
      * @param Handler\ResponseHandlerInterface $handler Response handler.
      */
     public function setHandler($prefix, Handler\ResponseHandlerInterface $handler)
@@ -64,7 +64,7 @@ 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 ResponseHandlerInterface
      */
     public function getHandler($prefix)
@@ -101,7 +101,7 @@ class ResponseReader implements ResponseReaderInterface
      * connection.
      *
      * @param ComposableConnectionInterface $connection Redis connection that generated the error.
-     * @param string $message Error message.
+     * @param string                        $message    Error message.
      */
     protected function onProtocolError(ComposableConnectionInterface $connection, $message)
     {

+ 7 - 7
lib/Predis/PubSub/AbstractConsumer.php

@@ -45,7 +45,7 @@ abstract class AbstractConsumer implements Iterator
     /**
      * Checks if the specified flag is valid based on the state of the consumer.
      *
-     * @param int $value Flag.
+     * @param  int     $value Flag.
      * @return Boolean
      */
     protected function isFlagSet($value)
@@ -99,7 +99,7 @@ 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)
@@ -126,15 +126,15 @@ abstract class AbstractConsumer implements Iterator
     /**
      * Closes the underlying connection when forcing a disconnection.
      */
-    protected abstract function disconnect();
+    abstract protected function disconnect();
 
     /**
      * Writes a Redis command on the underlying connection.
      *
-     * @param string $method Command ID.
-     * @param array $arguments Arguments for the command.
+     * @param string $method    Command ID.
+     * @param array  $arguments Arguments for the command.
      */
-    protected abstract function writeRequest($method, $arguments);
+    abstract protected function writeRequest($method, $arguments);
 
     /**
      * {@inheritdoc}
@@ -203,5 +203,5 @@ abstract class AbstractConsumer implements Iterator
      *
      * @return array
      */
-    protected abstract function getValue();
+    abstract protected function getValue();
 }

+ 2 - 2
lib/Predis/PubSub/Consumer.php

@@ -28,8 +28,8 @@ class Consumer extends AbstractConsumer
     private $options;
 
     /**
-     * @param ClientInterface $client Client instance used by the consumer.
-     * @param array $options Options for the consumer initialization.
+     * @param ClientInterface $client  Client instance used by the consumer.
+     * @param array           $options Options for the consumer initialization.
      */
     public function __construct(ClientInterface $client, array $options = null)
     {

+ 2 - 2
lib/Predis/PubSub/DispatcherLoop.php

@@ -91,7 +91,7 @@ class DispatcherLoop
     /**
      * Binds a callback to a channel.
      *
-     * @param string $channel Channel name.
+     * @param string   $channel  Channel name.
      * @param Callable $callback A callback.
      */
     public function attachCallback($channel, $callback)
@@ -138,7 +138,7 @@ class DispatcherLoop
             if (isset($this->callbacks[$message->channel])) {
                 $callback = $this->callbacks[$message->channel];
                 call_user_func($callback, $message->payload);
-            } else if (isset($this->defaultCallback)) {
+            } elseif (isset($this->defaultCallback)) {
                 $callback = $this->defaultCallback;
                 call_user_func($callback, $message);
             }

+ 7 - 6
lib/Predis/Replication/ReplicationStrategy.php

@@ -39,7 +39,7 @@ 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
      */
     public function isReadOperation(CommandInterface $command)
@@ -77,7 +77,7 @@ 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,12 +89,13 @@ 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)
     {
         $arguments = $command->getArguments();
+
         return ($c = count($arguments)) === 1 ? true : $arguments[$c - 2] !== 'STORE';
     }
 
@@ -106,7 +107,7 @@ class ReplicationStrategy
      * if the specified command performs a read or a write operation.
      *
      * @param string $commandID Command ID.
-     * @param mixed $readonly A boolean value or a callable object.
+     * @param mixed  $readonly  A boolean value or a callable object.
      */
     public function setCommandReadOnly($commandID, $readonly = true)
     {
@@ -126,8 +127,8 @@ class ReplicationStrategy
      * if the passed instance of EVAL or EVALSHA performs write operations or
      * not.
      *
-     * @param string $script Body of the Lua script.
-     * @param mixed $readonly A boolean value or a callable object.
+     * @param string $script   Body of the Lua script.
+     * @param mixed  $readonly A boolean value or a callable object.
      */
     public function setScriptReadOnly($script, $readonly = true)
     {

+ 1 - 0
lib/Predis/Response/Error.php

@@ -43,6 +43,7 @@ class Error implements ErrorInterface
     public function getErrorType()
     {
         list($errorType, ) = explode(' ', $this->getMessage(), 2);
+
         return $errorType;
     }
 

+ 1 - 1
lib/Predis/Response/Iterator/MultiBulk.php

@@ -24,7 +24,7 @@ class MultiBulk extends MultiBulkIterator
 
     /**
      * @param SingleConnectionInterface $connection Connection to Redis.
-     * @param int $size Number of elements of the multibulk response.
+     * @param int                       $size       Number of elements of the multibulk response.
      */
     public function __construct(SingleConnectionInterface $connection, $size)
     {

+ 1 - 1
lib/Predis/Response/Iterator/MultiBulkIterator.php

@@ -104,5 +104,5 @@ abstract class MultiBulkIterator implements Iterator, Countable, ResponseInterfa
     /**
      * {@inheritdoc}
      */
-    protected abstract function getValue();
+    abstract protected function getValue();
 }

+ 2 - 0
lib/Predis/Response/Status.php

@@ -66,12 +66,14 @@ class Status implements ResponseInterface
                 if (!isset(self::$OK)) {
                     self::$OK = new self('OK');
                 }
+
                 return self::$OK;
 
             case 'OK':
                 if (!isset(self::$QUEUED)) {
                     self::$QUEUED = new self('QUEUED');
                 }
+
                 return self::$QUEUED;
 
             default:

+ 2 - 5
lib/Predis/Session/Handler.php

@@ -30,8 +30,8 @@ class Handler implements SessionHandlerInterface
     protected $ttl;
 
     /**
-     * @param ClientInterface $client Fully initialized client instance.
-     * @param array $options Session handler options.
+     * @param ClientInterface $client  Fully initialized client instance.
+     * @param array           $options Session handler options.
      */
     public function __construct(ClientInterface $client, array $options = array())
     {
@@ -69,7 +69,6 @@ class Handler implements SessionHandlerInterface
     public function open($save_path, $session_id)
     {
         // NOOP
-
         return true;
     }
 
@@ -79,7 +78,6 @@ class Handler implements SessionHandlerInterface
     public function close()
     {
         // NOOP
-
         return true;
     }
 
@@ -89,7 +87,6 @@ class Handler implements SessionHandlerInterface
     public function gc($maxlifetime)
     {
         // NOOP
-
         return true;
     }
 

+ 2 - 2
lib/Predis/Transaction/AbortedMultiExecException.php

@@ -24,8 +24,8 @@ class AbortedMultiExecException extends PredisException
 
     /**
      * @param MultiExec $transaction Transaction that generated the exception.
-     * @param string $message Error message.
-     * @param int $code Error code.
+     * @param string    $message     Error message.
+     * @param int       $code        Error code.
      */
     public function __construct(MultiExec $transaction, $message, $code = null)
     {

+ 12 - 13
lib/Predis/Transaction/MultiExec.php

@@ -21,7 +21,6 @@ use Predis\CommunicationException;
 use Predis\ExecutableContextInterface;
 use Predis\NotSupportedException;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
-use Predis\Response\ResponseInterface;
 use Predis\Response\ServerException;
 use Predis\Response\Status as StatusResponse;
 use Predis\Command\CommandInterface;
@@ -45,8 +44,8 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     protected $modeCAS    = false;
 
     /**
-     * @param ClientInterface $client Client instance used by the transaction.
-     * @param array $options Initialization options.
+     * @param ClientInterface $client  Client instance used by the transaction.
+     * @param array           $options Initialization options.
      */
     public function __construct(ClientInterface $client, array $options = null)
     {
@@ -83,8 +82,8 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     /**
      * Configures the transaction using the provided options.
      *
-     * @param ClientInterface $client Underlying client instance.
-     * @param array $options Array of options for the transaction.
+     * @param ClientInterface $client  Underlying client instance.
+     * @param array           $options Array of options for the transaction.
      **/
     protected function configure(ClientInterface $client, array $options)
     {
@@ -151,8 +150,8 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     /**
      * 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,8 +165,8 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     /**
      * Executes a Redis command bypassing the transaction logic.
      *
-     * @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
      */
     protected function call($commandID, $arguments = array())
@@ -185,7 +184,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     /**
      * Executes the specified Redis command.
      *
-     * @param CommandInterface $command Command instance.
+     * @param  CommandInterface $command Command instance.
      * @return mixed
      */
     public function executeCommand(CommandInterface $command)
@@ -209,7 +208,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     /**
      * 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
      */
     public function watch($keys)
@@ -316,7 +315,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
                     'Cannot execute a transaction block after using fluent interface.'
                 );
             }
-        } else if ($this->attempts) {
+        } elseif ($this->attempts) {
             $this->discard();
 
             throw new InvalidArgumentException(
@@ -328,7 +327,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     /**
      * Handles the actual execution of the whole transaction.
      *
-     * @param mixed $callable Optional callback for execution.
+     * @param  mixed $callable Optional callback for execution.
      * @return array
      */
     public function execute($callable = null)

+ 1 - 1
lib/Predis/Transaction/MultiExecState.php

@@ -77,7 +77,7 @@ 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)