Bladeren bron

Run php-cs-fixer against codebase in src/ and tests/.

Daniele Alessandri 9 jaren geleden
bovenliggende
commit
82e404660e
100 gewijzigde bestanden met toevoegingen van 343 en 257 verwijderingen
  1. 3 3
      src/Autoloader.php
  2. 2 2
      src/Client.php
  3. 0 1
      src/ClientContextInterface.php
  4. 108 108
      src/Cluster/ClusterStrategy.php
  5. 3 3
      src/Cluster/Distributor/HashRing.php
  6. 1 1
      src/Cluster/Distributor/KetamaRing.php
  7. 1 1
      src/Cluster/Hash/CRC16.php
  8. 1 1
      src/Cluster/PredisStrategy.php
  9. 1 1
      src/Cluster/RedisStrategy.php
  10. 1 1
      src/Collection/Iterator/CursorBasedIterator.php
  11. 1 0
      src/Collection/Iterator/HashKey.php
  12. 1 0
      src/Collection/Iterator/Keyspace.php
  13. 2 1
      src/Collection/Iterator/ListKey.php
  14. 1 0
      src/Collection/Iterator/SetKey.php
  15. 1 0
      src/Collection/Iterator/SortedSetKey.php
  16. 1 0
      src/Command/ConnectionAuth.php
  17. 1 0
      src/Command/ConnectionEcho.php
  18. 1 0
      src/Command/ConnectionPing.php
  19. 1 0
      src/Command/ConnectionQuit.php
  20. 1 0
      src/Command/ConnectionSelect.php
  21. 1 0
      src/Command/HashDelete.php
  22. 1 0
      src/Command/HashExists.php
  23. 1 0
      src/Command/HashGet.php
  24. 2 1
      src/Command/HashGetAll.php
  25. 1 0
      src/Command/HashGetMultiple.php
  26. 1 0
      src/Command/HashIncrementBy.php
  27. 1 0
      src/Command/HashIncrementByFloat.php
  28. 1 0
      src/Command/HashKeys.php
  29. 1 0
      src/Command/HashLength.php
  30. 2 1
      src/Command/HashScan.php
  31. 1 0
      src/Command/HashSet.php
  32. 1 0
      src/Command/HashSetMultiple.php
  33. 1 0
      src/Command/HashSetPreserve.php
  34. 1 0
      src/Command/HashValues.php
  35. 1 0
      src/Command/HyperLogLogAdd.php
  36. 1 0
      src/Command/HyperLogLogCount.php
  37. 1 0
      src/Command/HyperLogLogMerge.php
  38. 1 0
      src/Command/KeyDelete.php
  39. 1 0
      src/Command/KeyDump.php
  40. 1 0
      src/Command/KeyExists.php
  41. 1 0
      src/Command/KeyExpire.php
  42. 1 0
      src/Command/KeyExpireAt.php
  43. 1 0
      src/Command/KeyKeys.php
  44. 1 0
      src/Command/KeyMigrate.php
  45. 1 0
      src/Command/KeyMove.php
  46. 1 0
      src/Command/KeyPersist.php
  47. 1 0
      src/Command/KeyPreciseExpire.php
  48. 1 0
      src/Command/KeyPreciseExpireAt.php
  49. 1 0
      src/Command/KeyPreciseTimeToLive.php
  50. 1 0
      src/Command/KeyRandom.php
  51. 1 0
      src/Command/KeyRename.php
  52. 1 0
      src/Command/KeyRenamePreserve.php
  53. 1 0
      src/Command/KeyRestore.php
  54. 1 0
      src/Command/KeyScan.php
  55. 1 1
      src/Command/KeySort.php
  56. 1 0
      src/Command/KeyTimeToLive.php
  57. 1 0
      src/Command/KeyType.php
  58. 1 0
      src/Command/ListIndex.php
  59. 1 0
      src/Command/ListInsert.php
  60. 1 0
      src/Command/ListLength.php
  61. 1 0
      src/Command/ListPopFirst.php
  62. 1 0
      src/Command/ListPopFirstBlocking.php
  63. 1 0
      src/Command/ListPopLast.php
  64. 1 0
      src/Command/ListPopLastBlocking.php
  65. 1 0
      src/Command/ListPopLastPushHead.php
  66. 1 0
      src/Command/ListPopLastPushHeadBlocking.php
  67. 1 0
      src/Command/ListPushHead.php
  68. 1 0
      src/Command/ListPushHeadX.php
  69. 1 0
      src/Command/ListPushTail.php
  70. 1 0
      src/Command/ListPushTailX.php
  71. 1 0
      src/Command/ListRange.php
  72. 1 0
      src/Command/ListRemove.php
  73. 1 0
      src/Command/ListSet.php
  74. 1 0
      src/Command/ListTrim.php
  75. 126 126
      src/Command/Processor/KeyPrefixProcessor.php
  76. 2 2
      src/Command/Processor/ProcessorChain.php
  77. 1 0
      src/Command/PubSubPublish.php
  78. 2 1
      src/Command/PubSubPubsub.php
  79. 1 0
      src/Command/PubSubSubscribe.php
  80. 1 0
      src/Command/PubSubSubscribeByPattern.php
  81. 1 0
      src/Command/PubSubUnsubscribe.php
  82. 1 0
      src/Command/PubSubUnsubscribeByPattern.php
  83. 1 0
      src/Command/ScriptCommand.php
  84. 1 0
      src/Command/ServerBackgroundRewriteAOF.php
  85. 1 0
      src/Command/ServerBackgroundSave.php
  86. 1 0
      src/Command/ServerClient.php
  87. 1 0
      src/Command/ServerCommand.php
  88. 2 1
      src/Command/ServerConfig.php
  89. 1 0
      src/Command/ServerDatabaseSize.php
  90. 1 0
      src/Command/ServerEval.php
  91. 1 0
      src/Command/ServerEvalSHA.php
  92. 1 0
      src/Command/ServerFlushAll.php
  93. 1 0
      src/Command/ServerFlushDatabase.php
  94. 2 1
      src/Command/ServerInfo.php
  95. 1 0
      src/Command/ServerInfoV26x.php
  96. 1 0
      src/Command/ServerLastSave.php
  97. 1 0
      src/Command/ServerMonitor.php
  98. 1 0
      src/Command/ServerObject.php
  99. 1 0
      src/Command/ServerSave.php
  100. 1 0
      src/Command/ServerScript.php

+ 3 - 3
src/Autoloader.php

@@ -29,7 +29,7 @@ class Autoloader
     public function __construct($baseDirectory = __DIR__)
     {
         $this->directory = $baseDirectory;
-        $this->prefix = __NAMESPACE__ . '\\';
+        $this->prefix = __NAMESPACE__.'\\';
         $this->prefixLength = strlen($this->prefix);
     }
 
@@ -40,7 +40,7 @@ class Autoloader
      */
     public static function register($prepend = false)
     {
-        spl_autoload_register(array(new self, 'autoload'), true, $prepend);
+        spl_autoload_register(array(new self(), 'autoload'), true, $prepend);
     }
 
     /**
@@ -55,7 +55,7 @@ class Autoloader
             $filepath = $this->directory.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts).'.php';
 
             if (is_file($filepath)) {
-                require($filepath);
+                require $filepath;
             }
         }
     }

+ 2 - 2
src/Client.php

@@ -80,7 +80,7 @@ class Client implements ClientInterface
             return $options;
         }
 
-        throw new InvalidArgumentException("Invalid type for client options.");
+        throw new InvalidArgumentException('Invalid type for client options.');
     }
 
     /**
@@ -433,7 +433,7 @@ class Client implements ClientInterface
             $class = 'Predis\Pipeline\Pipeline';
         }
 
-        /**
+        /*
          * @var ClientContextInterface
          */
         $pipeline = new $class($this);

+ 0 - 1
src/ClientContextInterface.php

@@ -159,7 +159,6 @@ use Predis\Command\CommandInterface;
  */
 interface ClientContextInterface
 {
-
     /**
      * Sends the specified command instance to Redis.
      *

+ 108 - 108
src/Cluster/ClusterStrategy.php

@@ -44,126 +44,126 @@ abstract class ClusterStrategy implements StrategyInterface
 
         return array(
             /* commands operating on the key space */
-            'EXISTS'                => $getKeyFromFirstArgument,
-            'DEL'                   => $getKeyFromAllArguments,
-            'TYPE'                  => $getKeyFromFirstArgument,
-            'EXPIRE'                => $getKeyFromFirstArgument,
-            'EXPIREAT'              => $getKeyFromFirstArgument,
-            'PERSIST'               => $getKeyFromFirstArgument,
-            'PEXPIRE'               => $getKeyFromFirstArgument,
-            'PEXPIREAT'             => $getKeyFromFirstArgument,
-            'TTL'                   => $getKeyFromFirstArgument,
-            'PTTL'                  => $getKeyFromFirstArgument,
-            'SORT'                  => $getKeyFromFirstArgument, // TODO
-            'DUMP'                  => $getKeyFromFirstArgument,
-            'RESTORE'               => $getKeyFromFirstArgument,
+            'EXISTS' => $getKeyFromFirstArgument,
+            'DEL' => $getKeyFromAllArguments,
+            'TYPE' => $getKeyFromFirstArgument,
+            'EXPIRE' => $getKeyFromFirstArgument,
+            'EXPIREAT' => $getKeyFromFirstArgument,
+            'PERSIST' => $getKeyFromFirstArgument,
+            'PEXPIRE' => $getKeyFromFirstArgument,
+            'PEXPIREAT' => $getKeyFromFirstArgument,
+            'TTL' => $getKeyFromFirstArgument,
+            'PTTL' => $getKeyFromFirstArgument,
+            'SORT' => $getKeyFromFirstArgument, // TODO
+            'DUMP' => $getKeyFromFirstArgument,
+            'RESTORE' => $getKeyFromFirstArgument,
 
             /* commands operating on string values */
-            'APPEND'                => $getKeyFromFirstArgument,
-            'DECR'                  => $getKeyFromFirstArgument,
-            'DECRBY'                => $getKeyFromFirstArgument,
-            'GET'                   => $getKeyFromFirstArgument,
-            'GETBIT'                => $getKeyFromFirstArgument,
-            'MGET'                  => $getKeyFromAllArguments,
-            'SET'                   => $getKeyFromFirstArgument,
-            'GETRANGE'              => $getKeyFromFirstArgument,
-            'GETSET'                => $getKeyFromFirstArgument,
-            'INCR'                  => $getKeyFromFirstArgument,
-            'INCRBY'                => $getKeyFromFirstArgument,
-            'INCRBYFLOAT'           => $getKeyFromFirstArgument,
-            'SETBIT'                => $getKeyFromFirstArgument,
-            'SETEX'                 => $getKeyFromFirstArgument,
-            'MSET'                  => array($this, 'getKeyFromInterleavedArguments'),
-            'MSETNX'                => array($this, 'getKeyFromInterleavedArguments'),
-            'SETNX'                 => $getKeyFromFirstArgument,
-            'SETRANGE'              => $getKeyFromFirstArgument,
-            'STRLEN'                => $getKeyFromFirstArgument,
-            'SUBSTR'                => $getKeyFromFirstArgument,
-            'BITOP'                 => array($this, 'getKeyFromBitOp'),
-            'BITCOUNT'              => $getKeyFromFirstArgument,
+            'APPEND' => $getKeyFromFirstArgument,
+            'DECR' => $getKeyFromFirstArgument,
+            'DECRBY' => $getKeyFromFirstArgument,
+            'GET' => $getKeyFromFirstArgument,
+            'GETBIT' => $getKeyFromFirstArgument,
+            'MGET' => $getKeyFromAllArguments,
+            'SET' => $getKeyFromFirstArgument,
+            'GETRANGE' => $getKeyFromFirstArgument,
+            'GETSET' => $getKeyFromFirstArgument,
+            'INCR' => $getKeyFromFirstArgument,
+            'INCRBY' => $getKeyFromFirstArgument,
+            'INCRBYFLOAT' => $getKeyFromFirstArgument,
+            'SETBIT' => $getKeyFromFirstArgument,
+            'SETEX' => $getKeyFromFirstArgument,
+            'MSET' => array($this, 'getKeyFromInterleavedArguments'),
+            'MSETNX' => array($this, 'getKeyFromInterleavedArguments'),
+            'SETNX' => $getKeyFromFirstArgument,
+            'SETRANGE' => $getKeyFromFirstArgument,
+            'STRLEN' => $getKeyFromFirstArgument,
+            'SUBSTR' => $getKeyFromFirstArgument,
+            'BITOP' => array($this, 'getKeyFromBitOp'),
+            'BITCOUNT' => $getKeyFromFirstArgument,
 
             /* commands operating on lists */
-            'LINSERT'               => $getKeyFromFirstArgument,
-            'LINDEX'                => $getKeyFromFirstArgument,
-            'LLEN'                  => $getKeyFromFirstArgument,
-            'LPOP'                  => $getKeyFromFirstArgument,
-            'RPOP'                  => $getKeyFromFirstArgument,
-            'RPOPLPUSH'             => $getKeyFromAllArguments,
-            'BLPOP'                 => array($this, 'getKeyFromBlockingListCommands'),
-            'BRPOP'                 => array($this, 'getKeyFromBlockingListCommands'),
-            'BRPOPLPUSH'            => array($this, 'getKeyFromBlockingListCommands'),
-            'LPUSH'                 => $getKeyFromFirstArgument,
-            'LPUSHX'                => $getKeyFromFirstArgument,
-            'RPUSH'                 => $getKeyFromFirstArgument,
-            'RPUSHX'                => $getKeyFromFirstArgument,
-            'LRANGE'                => $getKeyFromFirstArgument,
-            'LREM'                  => $getKeyFromFirstArgument,
-            'LSET'                  => $getKeyFromFirstArgument,
-            'LTRIM'                 => $getKeyFromFirstArgument,
+            'LINSERT' => $getKeyFromFirstArgument,
+            'LINDEX' => $getKeyFromFirstArgument,
+            'LLEN' => $getKeyFromFirstArgument,
+            'LPOP' => $getKeyFromFirstArgument,
+            'RPOP' => $getKeyFromFirstArgument,
+            'RPOPLPUSH' => $getKeyFromAllArguments,
+            'BLPOP' => array($this, 'getKeyFromBlockingListCommands'),
+            'BRPOP' => array($this, 'getKeyFromBlockingListCommands'),
+            'BRPOPLPUSH' => array($this, 'getKeyFromBlockingListCommands'),
+            'LPUSH' => $getKeyFromFirstArgument,
+            'LPUSHX' => $getKeyFromFirstArgument,
+            'RPUSH' => $getKeyFromFirstArgument,
+            'RPUSHX' => $getKeyFromFirstArgument,
+            'LRANGE' => $getKeyFromFirstArgument,
+            'LREM' => $getKeyFromFirstArgument,
+            'LSET' => $getKeyFromFirstArgument,
+            'LTRIM' => $getKeyFromFirstArgument,
 
             /* commands operating on sets */
-            'SADD'                  => $getKeyFromFirstArgument,
-            'SCARD'                 => $getKeyFromFirstArgument,
-            'SDIFF'                 => $getKeyFromAllArguments,
-            'SDIFFSTORE'            => $getKeyFromAllArguments,
-            'SINTER'                => $getKeyFromAllArguments,
-            'SINTERSTORE'           => $getKeyFromAllArguments,
-            'SUNION'                => $getKeyFromAllArguments,
-            'SUNIONSTORE'           => $getKeyFromAllArguments,
-            'SISMEMBER'             => $getKeyFromFirstArgument,
-            'SMEMBERS'              => $getKeyFromFirstArgument,
-            'SSCAN'                 => $getKeyFromFirstArgument,
-            'SPOP'                  => $getKeyFromFirstArgument,
-            'SRANDMEMBER'           => $getKeyFromFirstArgument,
-            'SREM'                  => $getKeyFromFirstArgument,
+            'SADD' => $getKeyFromFirstArgument,
+            'SCARD' => $getKeyFromFirstArgument,
+            'SDIFF' => $getKeyFromAllArguments,
+            'SDIFFSTORE' => $getKeyFromAllArguments,
+            'SINTER' => $getKeyFromAllArguments,
+            'SINTERSTORE' => $getKeyFromAllArguments,
+            'SUNION' => $getKeyFromAllArguments,
+            'SUNIONSTORE' => $getKeyFromAllArguments,
+            'SISMEMBER' => $getKeyFromFirstArgument,
+            'SMEMBERS' => $getKeyFromFirstArgument,
+            'SSCAN' => $getKeyFromFirstArgument,
+            'SPOP' => $getKeyFromFirstArgument,
+            'SRANDMEMBER' => $getKeyFromFirstArgument,
+            'SREM' => $getKeyFromFirstArgument,
 
             /* commands operating on sorted sets */
-            'ZADD'                  => $getKeyFromFirstArgument,
-            'ZCARD'                 => $getKeyFromFirstArgument,
-            'ZCOUNT'                => $getKeyFromFirstArgument,
-            'ZINCRBY'               => $getKeyFromFirstArgument,
-            'ZINTERSTORE'           => array($this, 'getKeyFromZsetAggregationCommands'),
-            'ZRANGE'                => $getKeyFromFirstArgument,
-            'ZRANGEBYSCORE'         => $getKeyFromFirstArgument,
-            'ZRANK'                 => $getKeyFromFirstArgument,
-            'ZREM'                  => $getKeyFromFirstArgument,
-            'ZREMRANGEBYRANK'       => $getKeyFromFirstArgument,
-            'ZREMRANGEBYSCORE'      => $getKeyFromFirstArgument,
-            'ZREVRANGE'             => $getKeyFromFirstArgument,
-            'ZREVRANGEBYSCORE'      => $getKeyFromFirstArgument,
-            'ZREVRANK'              => $getKeyFromFirstArgument,
-            'ZSCORE'                => $getKeyFromFirstArgument,
-            'ZUNIONSTORE'           => array($this, 'getKeyFromZsetAggregationCommands'),
-            'ZSCAN'                 => $getKeyFromFirstArgument,
-            'ZLEXCOUNT'             => $getKeyFromFirstArgument,
-            'ZRANGEBYLEX'           => $getKeyFromFirstArgument,
-            'ZREMRANGEBYLEX'        => $getKeyFromFirstArgument,
-            'ZREVRANGEBYLEX'        => $getKeyFromFirstArgument,
+            'ZADD' => $getKeyFromFirstArgument,
+            'ZCARD' => $getKeyFromFirstArgument,
+            'ZCOUNT' => $getKeyFromFirstArgument,
+            'ZINCRBY' => $getKeyFromFirstArgument,
+            'ZINTERSTORE' => array($this, 'getKeyFromZsetAggregationCommands'),
+            'ZRANGE' => $getKeyFromFirstArgument,
+            'ZRANGEBYSCORE' => $getKeyFromFirstArgument,
+            'ZRANK' => $getKeyFromFirstArgument,
+            'ZREM' => $getKeyFromFirstArgument,
+            'ZREMRANGEBYRANK' => $getKeyFromFirstArgument,
+            'ZREMRANGEBYSCORE' => $getKeyFromFirstArgument,
+            'ZREVRANGE' => $getKeyFromFirstArgument,
+            'ZREVRANGEBYSCORE' => $getKeyFromFirstArgument,
+            'ZREVRANK' => $getKeyFromFirstArgument,
+            'ZSCORE' => $getKeyFromFirstArgument,
+            'ZUNIONSTORE' => array($this, 'getKeyFromZsetAggregationCommands'),
+            'ZSCAN' => $getKeyFromFirstArgument,
+            'ZLEXCOUNT' => $getKeyFromFirstArgument,
+            'ZRANGEBYLEX' => $getKeyFromFirstArgument,
+            'ZREMRANGEBYLEX' => $getKeyFromFirstArgument,
+            'ZREVRANGEBYLEX' => $getKeyFromFirstArgument,
 
             /* commands operating on hashes */
-            'HDEL'                  => $getKeyFromFirstArgument,
-            'HEXISTS'               => $getKeyFromFirstArgument,
-            'HGET'                  => $getKeyFromFirstArgument,
-            'HGETALL'               => $getKeyFromFirstArgument,
-            'HMGET'                 => $getKeyFromFirstArgument,
-            'HMSET'                 => $getKeyFromFirstArgument,
-            'HINCRBY'               => $getKeyFromFirstArgument,
-            'HINCRBYFLOAT'          => $getKeyFromFirstArgument,
-            'HKEYS'                 => $getKeyFromFirstArgument,
-            'HLEN'                  => $getKeyFromFirstArgument,
-            'HSET'                  => $getKeyFromFirstArgument,
-            'HSETNX'                => $getKeyFromFirstArgument,
-            'HVALS'                 => $getKeyFromFirstArgument,
-            'HSCAN'                 => $getKeyFromFirstArgument,
+            'HDEL' => $getKeyFromFirstArgument,
+            'HEXISTS' => $getKeyFromFirstArgument,
+            'HGET' => $getKeyFromFirstArgument,
+            'HGETALL' => $getKeyFromFirstArgument,
+            'HMGET' => $getKeyFromFirstArgument,
+            'HMSET' => $getKeyFromFirstArgument,
+            'HINCRBY' => $getKeyFromFirstArgument,
+            'HINCRBYFLOAT' => $getKeyFromFirstArgument,
+            'HKEYS' => $getKeyFromFirstArgument,
+            'HLEN' => $getKeyFromFirstArgument,
+            'HSET' => $getKeyFromFirstArgument,
+            'HSETNX' => $getKeyFromFirstArgument,
+            'HVALS' => $getKeyFromFirstArgument,
+            'HSCAN' => $getKeyFromFirstArgument,
 
             /* commands operating on HyperLogLog */
-            'PFADD'                 => $getKeyFromFirstArgument,
-            'PFCOUNT'               => $getKeyFromAllArguments,
-            'PFMERGE'               => $getKeyFromAllArguments,
+            'PFADD' => $getKeyFromFirstArgument,
+            'PFCOUNT' => $getKeyFromAllArguments,
+            'PFMERGE' => $getKeyFromAllArguments,
 
             /* scripting */
-            'EVAL'                  => array($this, 'getKeyFromScriptingCommands'),
-            'EVALSHA'               => array($this, 'getKeyFromScriptingCommands'),
+            'EVAL' => array($this, 'getKeyFromScriptingCommands'),
+            'EVALSHA' => array($this, 'getKeyFromScriptingCommands'),
         );
     }
 
@@ -203,7 +203,7 @@ abstract class ClusterStrategy implements StrategyInterface
 
         if (!is_callable($callback)) {
             throw new InvalidArgumentException(
-                "The argument must be a callable object or NULL."
+                'The argument must be a callable object or NULL.'
             );
         }
 
@@ -364,7 +364,7 @@ abstract class ClusterStrategy implements StrategyInterface
 
         $currentSlot = $this->getSlotByKey($keys[0]);
 
-        for ($i = 1; $i < $count; $i++) {
+        for ($i = 1; $i < $count; ++$i) {
             $nextSlot = $this->getSlotByKey($keys[$i]);
 
             if ($currentSlot !== $nextSlot) {

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

@@ -24,7 +24,7 @@ use Predis\Cluster\Hash\HashGeneratorInterface;
 class HashRing implements DistributorInterface, HashGeneratorInterface
 {
     const DEFAULT_REPLICAS = 128;
-    const DEFAULT_WEIGHT   = 100;
+    const DEFAULT_WEIGHT = 100;
 
     private $ring;
     private $ringKeys;
@@ -55,7 +55,7 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
         // last wins, thus the order in which nodes are added is significant.
         $this->nodes[] = array(
             'object' => $node,
-            'weight' => (int) $weight ?: $this::DEFAULT_WEIGHT
+            'weight' => (int) $weight ?: $this::DEFAULT_WEIGHT,
         );
 
         $this->reset();
@@ -160,7 +160,7 @@ class HashRing implements DistributorInterface, HashGeneratorInterface
         $nodeHash = $this->getNodeHash($nodeObject);
         $replicas = (int) round($weightRatio * $totalNodes * $replicas);
 
-        for ($i = 0; $i < $replicas; $i++) {
+        for ($i = 0; $i < $replicas; ++$i) {
             $key = crc32("$nodeHash:$i");
             $ring[$key] = $nodeObject;
         }

+ 1 - 1
src/Cluster/Distributor/KetamaRing.php

@@ -40,7 +40,7 @@ class KetamaRing extends HashRing
         $nodeHash = $this->getNodeHash($nodeObject);
         $replicas = (int) floor($weightRatio * $totalNodes * ($replicas / 4));
 
-        for ($i = 0; $i < $replicas; $i++) {
+        for ($i = 0; $i < $replicas; ++$i) {
             $unpackedDigest = unpack('V4', md5("$nodeHash-$i", true));
 
             foreach ($unpackedDigest as $key) {

+ 1 - 1
src/Cluster/Hash/CRC16.php

@@ -63,7 +63,7 @@ class CRC16 implements HashGeneratorInterface
         $CCITT_16 = self::$CCITT_16;
         $strlen = strlen($value);
 
-        for ($i = 0; $i < $strlen; $i++) {
+        for ($i = 0; $i < $strlen; ++$i) {
             $crc = (($crc << 8) ^ $CCITT_16[($crc >> 8) ^ ord($value[$i])]) & 0xFFFF;
         }
 

+ 1 - 1
src/Cluster/PredisStrategy.php

@@ -56,7 +56,7 @@ class PredisStrategy extends ClusterStrategy
 
         $currentKey = $this->extractKeyTag($keys[0]);
 
-        for ($i = 1; $i < $count; $i++) {
+        for ($i = 1; $i < $count; ++$i) {
             $nextKey = $this->extractKeyTag($keys[$i]);
 
             if ($currentKey !== $nextKey) {

+ 1 - 1
src/Cluster/RedisStrategy.php

@@ -40,7 +40,7 @@ class RedisStrategy extends ClusterStrategy
      */
     public function getSlotByKey($key)
     {
-        $key  = $this->extractKeyTag($key);
+        $key = $this->extractKeyTag($key);
         $slot = $this->hashGenerator->hash($key) & 0x3FFF;
 
         return $slot;

+ 1 - 1
src/Collection/Iterator/CursorBasedIterator.php

@@ -133,7 +133,7 @@ abstract class CursorBasedIterator implements Iterator
      */
     protected function extractNext()
     {
-        $this->position++;
+        ++$this->position;
         $this->current = array_shift($this->elements);
     }
 

+ 1 - 0
src/Collection/Iterator/HashKey.php

@@ -18,6 +18,7 @@ use Predis\ClientInterface;
  * HSCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
+ *
  * @link http://redis.io/commands/scan
  */
 class HashKey extends CursorBasedIterator

+ 1 - 0
src/Collection/Iterator/Keyspace.php

@@ -18,6 +18,7 @@ use Predis\ClientInterface;
  * SCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
+ *
  * @link http://redis.io/commands/scan
  */
 class Keyspace extends CursorBasedIterator

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

@@ -27,6 +27,7 @@ use Predis\NotSupportedException;
  * times (trimmed, deleted, overwritten) during the iteration process.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
+ *
  * @link http://redis.io/commands/lrange
  */
 class ListKey implements Iterator
@@ -122,7 +123,7 @@ class ListKey implements Iterator
      */
     protected function extractNext()
     {
-        $this->position++;
+        ++$this->position;
         $this->current = array_shift($this->elements);
     }
 

+ 1 - 0
src/Collection/Iterator/SetKey.php

@@ -18,6 +18,7 @@ use Predis\ClientInterface;
  * command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
+ *
  * @link http://redis.io/commands/scan
  */
 class SetKey extends CursorBasedIterator

+ 1 - 0
src/Collection/Iterator/SortedSetKey.php

@@ -18,6 +18,7 @@ use Predis\ClientInterface;
  * ZSCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
+ *
  * @link http://redis.io/commands/scan
  */
 class SortedSetKey extends CursorBasedIterator

+ 1 - 0
src/Command/ConnectionAuth.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/auth
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ConnectionAuth extends Command

+ 1 - 0
src/Command/ConnectionEcho.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/echo
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ConnectionEcho extends Command

+ 1 - 0
src/Command/ConnectionPing.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/ping
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ConnectionPing extends Command

+ 1 - 0
src/Command/ConnectionQuit.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/quit
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ConnectionQuit extends Command

+ 1 - 0
src/Command/ConnectionSelect.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/select
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ConnectionSelect extends Command

+ 1 - 0
src/Command/HashDelete.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hdel
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashDelete extends Command

+ 1 - 0
src/Command/HashExists.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hexists
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashExists extends Command

+ 1 - 0
src/Command/HashGet.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hget
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashGet extends Command

+ 2 - 1
src/Command/HashGetAll.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hgetall
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashGetAll extends Command
@@ -32,7 +33,7 @@ class HashGetAll extends Command
     {
         $result = array();
 
-        for ($i = 0; $i < count($data); $i++) {
+        for ($i = 0; $i < count($data); ++$i) {
             $result[$data[$i]] = $data[++$i];
         }
 

+ 1 - 0
src/Command/HashGetMultiple.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hmget
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashGetMultiple extends Command

+ 1 - 0
src/Command/HashIncrementBy.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hincrby
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashIncrementBy extends Command

+ 1 - 0
src/Command/HashIncrementByFloat.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hincrbyfloat
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashIncrementByFloat extends Command

+ 1 - 0
src/Command/HashKeys.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hkeys
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashKeys extends Command

+ 1 - 0
src/Command/HashLength.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hlen
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashLength extends Command

+ 2 - 1
src/Command/HashScan.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hscan
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashScan extends Command
@@ -72,7 +73,7 @@ class HashScan extends Command
             $fields = $data[1];
             $result = array();
 
-            for ($i = 0; $i < count($fields); $i++) {
+            for ($i = 0; $i < count($fields); ++$i) {
                 $result[$fields[$i]] = $fields[++$i];
             }
 

+ 1 - 0
src/Command/HashSet.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hset
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashSet extends Command

+ 1 - 0
src/Command/HashSetMultiple.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hmset
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashSetMultiple extends Command

+ 1 - 0
src/Command/HashSetPreserve.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hsetnx
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashSetPreserve extends Command

+ 1 - 0
src/Command/HashValues.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/hvals
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HashValues extends Command

+ 1 - 0
src/Command/HyperLogLogAdd.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pfadd
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HyperLogLogAdd extends Command

+ 1 - 0
src/Command/HyperLogLogCount.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pfcount
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HyperLogLogCount extends Command

+ 1 - 0
src/Command/HyperLogLogMerge.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pfmerge
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class HyperLogLogMerge extends Command

+ 1 - 0
src/Command/KeyDelete.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/del
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyDelete extends Command

+ 1 - 0
src/Command/KeyDump.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/dump
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyDump extends Command

+ 1 - 0
src/Command/KeyExists.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/exists
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyExists extends Command

+ 1 - 0
src/Command/KeyExpire.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/expire
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyExpire extends Command

+ 1 - 0
src/Command/KeyExpireAt.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/expireat
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyExpireAt extends Command

+ 1 - 0
src/Command/KeyKeys.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/keys
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyKeys extends Command

+ 1 - 0
src/Command/KeyMigrate.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/migrate
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyMigrate extends Command

+ 1 - 0
src/Command/KeyMove.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/move
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyMove extends Command

+ 1 - 0
src/Command/KeyPersist.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/persist
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyPersist extends Command

+ 1 - 0
src/Command/KeyPreciseExpire.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pexpire
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyPreciseExpire extends KeyExpire

+ 1 - 0
src/Command/KeyPreciseExpireAt.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pexpireat
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyPreciseExpireAt extends KeyExpireAt

+ 1 - 0
src/Command/KeyPreciseTimeToLive.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pttl
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyPreciseTimeToLive extends KeyTimeToLive

+ 1 - 0
src/Command/KeyRandom.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/randomkey
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyRandom extends Command

+ 1 - 0
src/Command/KeyRename.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/rename
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyRename extends Command

+ 1 - 0
src/Command/KeyRenamePreserve.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/renamenx
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyRenamePreserve extends KeyRename

+ 1 - 0
src/Command/KeyRestore.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/restore
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyRestore extends Command

+ 1 - 0
src/Command/KeyScan.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/scan
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyScan extends Command

+ 1 - 1
src/Command/KeySort.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/sort
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeySort extends Command
@@ -59,7 +60,6 @@ class KeySort extends Command
         if (isset($sortParams['LIMIT']) &&
             is_array($sortParams['LIMIT']) &&
             count($sortParams['LIMIT']) == 2) {
-
             $query[] = 'LIMIT';
             $query[] = $sortParams['LIMIT'][0];
             $query[] = $sortParams['LIMIT'][1];

+ 1 - 0
src/Command/KeyTimeToLive.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/ttl
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyTimeToLive extends Command

+ 1 - 0
src/Command/KeyType.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/type
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class KeyType extends Command

+ 1 - 0
src/Command/ListIndex.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lindex
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListIndex extends Command

+ 1 - 0
src/Command/ListInsert.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/linsert
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListInsert extends Command

+ 1 - 0
src/Command/ListLength.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/llen
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListLength extends Command

+ 1 - 0
src/Command/ListPopFirst.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lpop
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPopFirst extends Command

+ 1 - 0
src/Command/ListPopFirstBlocking.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/blpop
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPopFirstBlocking extends Command

+ 1 - 0
src/Command/ListPopLast.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/rpop
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPopLast extends Command

+ 1 - 0
src/Command/ListPopLastBlocking.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/brpop
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPopLastBlocking extends ListPopFirstBlocking

+ 1 - 0
src/Command/ListPopLastPushHead.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/rpoplpush
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPopLastPushHead extends Command

+ 1 - 0
src/Command/ListPopLastPushHeadBlocking.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/brpoplpush
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPopLastPushHeadBlocking extends Command

+ 1 - 0
src/Command/ListPushHead.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lpush
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPushHead extends ListPushTail

+ 1 - 0
src/Command/ListPushHeadX.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lpushx
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPushHeadX extends Command

+ 1 - 0
src/Command/ListPushTail.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/rpush
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPushTail extends Command

+ 1 - 0
src/Command/ListPushTailX.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/rpushx
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListPushTailX extends Command

+ 1 - 0
src/Command/ListRange.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lrange
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListRange extends Command

+ 1 - 0
src/Command/ListRemove.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lrem
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListRemove extends Command

+ 1 - 0
src/Command/ListSet.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lset
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListSet extends Command

+ 1 - 0
src/Command/ListTrim.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/ltrim
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ListTrim extends Command

+ 126 - 126
src/Command/Processor/KeyPrefixProcessor.php

@@ -34,130 +34,130 @@ class KeyPrefixProcessor implements ProcessorInterface
         $this->prefix = $prefix;
         $this->commands = array(
             /* ---------------- Redis 1.2 ---------------- */
-            'EXISTS'                    => 'self::first',
-            'DEL'                       => 'self::all',
-            'TYPE'                      => 'self::first',
-            'KEYS'                      => 'self::first',
-            'RENAME'                    => 'self::all',
-            'RENAMENX'                  => 'self::all',
-            'EXPIRE'                    => 'self::first',
-            'EXPIREAT'                  => 'self::first',
-            'TTL'                       => 'self::first',
-            'MOVE'                      => 'self::first',
-            'SORT'                      => 'self::sort',
-            'DUMP'                      => 'self::first',
-            'RESTORE'                   => 'self::first',
-            'SET'                       => 'self::first',
-            'SETNX'                     => 'self::first',
-            'MSET'                      => 'self::interleaved',
-            'MSETNX'                    => 'self::interleaved',
-            'GET'                       => 'self::first',
-            'MGET'                      => 'self::all',
-            'GETSET'                    => 'self::first',
-            'INCR'                      => 'self::first',
-            'INCRBY'                    => 'self::first',
-            'DECR'                      => 'self::first',
-            'DECRBY'                    => 'self::first',
-            'RPUSH'                     => 'self::first',
-            'LPUSH'                     => 'self::first',
-            'LLEN'                      => 'self::first',
-            'LRANGE'                    => 'self::first',
-            'LTRIM'                     => 'self::first',
-            'LINDEX'                    => 'self::first',
-            'LSET'                      => 'self::first',
-            'LREM'                      => 'self::first',
-            'LPOP'                      => 'self::first',
-            'RPOP'                      => 'self::first',
-            'RPOPLPUSH'                 => 'self::all',
-            'SADD'                      => 'self::first',
-            'SREM'                      => 'self::first',
-            'SPOP'                      => 'self::first',
-            'SMOVE'                     => 'self::skipLast',
-            'SCARD'                     => 'self::first',
-            'SISMEMBER'                 => 'self::first',
-            'SINTER'                    => 'self::all',
-            'SINTERSTORE'               => 'self::all',
-            'SUNION'                    => 'self::all',
-            'SUNIONSTORE'               => 'self::all',
-            'SDIFF'                     => 'self::all',
-            'SDIFFSTORE'                => 'self::all',
-            'SMEMBERS'                  => 'self::first',
-            'SRANDMEMBER'               => 'self::first',
-            'ZADD'                      => 'self::first',
-            'ZINCRBY'                   => 'self::first',
-            'ZREM'                      => 'self::first',
-            'ZRANGE'                    => 'self::first',
-            'ZREVRANGE'                 => 'self::first',
-            'ZRANGEBYSCORE'             => 'self::first',
-            'ZCARD'                     => 'self::first',
-            'ZSCORE'                    => 'self::first',
-            'ZREMRANGEBYSCORE'          => 'self::first',
+            'EXISTS' => 'self::first',
+            'DEL' => 'self::all',
+            'TYPE' => 'self::first',
+            'KEYS' => 'self::first',
+            'RENAME' => 'self::all',
+            'RENAMENX' => 'self::all',
+            'EXPIRE' => 'self::first',
+            'EXPIREAT' => 'self::first',
+            'TTL' => 'self::first',
+            'MOVE' => 'self::first',
+            'SORT' => 'self::sort',
+            'DUMP' => 'self::first',
+            'RESTORE' => 'self::first',
+            'SET' => 'self::first',
+            'SETNX' => 'self::first',
+            'MSET' => 'self::interleaved',
+            'MSETNX' => 'self::interleaved',
+            'GET' => 'self::first',
+            'MGET' => 'self::all',
+            'GETSET' => 'self::first',
+            'INCR' => 'self::first',
+            'INCRBY' => 'self::first',
+            'DECR' => 'self::first',
+            'DECRBY' => 'self::first',
+            'RPUSH' => 'self::first',
+            'LPUSH' => 'self::first',
+            'LLEN' => 'self::first',
+            'LRANGE' => 'self::first',
+            'LTRIM' => 'self::first',
+            'LINDEX' => 'self::first',
+            'LSET' => 'self::first',
+            'LREM' => 'self::first',
+            'LPOP' => 'self::first',
+            'RPOP' => 'self::first',
+            'RPOPLPUSH' => 'self::all',
+            'SADD' => 'self::first',
+            'SREM' => 'self::first',
+            'SPOP' => 'self::first',
+            'SMOVE' => 'self::skipLast',
+            'SCARD' => 'self::first',
+            'SISMEMBER' => 'self::first',
+            'SINTER' => 'self::all',
+            'SINTERSTORE' => 'self::all',
+            'SUNION' => 'self::all',
+            'SUNIONSTORE' => 'self::all',
+            'SDIFF' => 'self::all',
+            'SDIFFSTORE' => 'self::all',
+            'SMEMBERS' => 'self::first',
+            'SRANDMEMBER' => 'self::first',
+            'ZADD' => 'self::first',
+            'ZINCRBY' => 'self::first',
+            'ZREM' => 'self::first',
+            'ZRANGE' => 'self::first',
+            'ZREVRANGE' => 'self::first',
+            'ZRANGEBYSCORE' => 'self::first',
+            'ZCARD' => 'self::first',
+            'ZSCORE' => 'self::first',
+            'ZREMRANGEBYSCORE' => 'self::first',
             /* ---------------- Redis 2.0 ---------------- */
-            'SETEX'                     => 'self::first',
-            'APPEND'                    => 'self::first',
-            'SUBSTR'                    => 'self::first',
-            'BLPOP'                     => 'self::skipLast',
-            'BRPOP'                     => 'self::skipLast',
-            'ZUNIONSTORE'               => 'self::zsetStore',
-            'ZINTERSTORE'               => 'self::zsetStore',
-            'ZCOUNT'                    => 'self::first',
-            'ZRANK'                     => 'self::first',
-            'ZREVRANK'                  => 'self::first',
-            'ZREMRANGEBYRANK'           => 'self::first',
-            'HSET'                      => 'self::first',
-            'HSETNX'                    => 'self::first',
-            'HMSET'                     => 'self::first',
-            'HINCRBY'                   => 'self::first',
-            'HGET'                      => 'self::first',
-            'HMGET'                     => 'self::first',
-            'HDEL'                      => 'self::first',
-            'HEXISTS'                   => 'self::first',
-            'HLEN'                      => 'self::first',
-            'HKEYS'                     => 'self::first',
-            'HVALS'                     => 'self::first',
-            'HGETALL'                   => 'self::first',
-            'SUBSCRIBE'                 => 'self::all',
-            'UNSUBSCRIBE'               => 'self::all',
-            'PSUBSCRIBE'                => 'self::all',
-            'PUNSUBSCRIBE'              => 'self::all',
-            'PUBLISH'                   => 'self::first',
+            'SETEX' => 'self::first',
+            'APPEND' => 'self::first',
+            'SUBSTR' => 'self::first',
+            'BLPOP' => 'self::skipLast',
+            'BRPOP' => 'self::skipLast',
+            'ZUNIONSTORE' => 'self::zsetStore',
+            'ZINTERSTORE' => 'self::zsetStore',
+            'ZCOUNT' => 'self::first',
+            'ZRANK' => 'self::first',
+            'ZREVRANK' => 'self::first',
+            'ZREMRANGEBYRANK' => 'self::first',
+            'HSET' => 'self::first',
+            'HSETNX' => 'self::first',
+            'HMSET' => 'self::first',
+            'HINCRBY' => 'self::first',
+            'HGET' => 'self::first',
+            'HMGET' => 'self::first',
+            'HDEL' => 'self::first',
+            'HEXISTS' => 'self::first',
+            'HLEN' => 'self::first',
+            'HKEYS' => 'self::first',
+            'HVALS' => 'self::first',
+            'HGETALL' => 'self::first',
+            'SUBSCRIBE' => 'self::all',
+            'UNSUBSCRIBE' => 'self::all',
+            'PSUBSCRIBE' => 'self::all',
+            'PUNSUBSCRIBE' => 'self::all',
+            'PUBLISH' => 'self::first',
             /* ---------------- Redis 2.2 ---------------- */
-            'PERSIST'                   => 'self::first',
-            'STRLEN'                    => 'self::first',
-            'SETRANGE'                  => 'self::first',
-            'GETRANGE'                  => 'self::first',
-            'SETBIT'                    => 'self::first',
-            'GETBIT'                    => 'self::first',
-            'RPUSHX'                    => 'self::first',
-            'LPUSHX'                    => 'self::first',
-            'LINSERT'                   => 'self::first',
-            'BRPOPLPUSH'                => 'self::skipLast',
-            'ZREVRANGEBYSCORE'          => 'self::first',
-            'WATCH'                     => 'self::all',
+            'PERSIST' => 'self::first',
+            'STRLEN' => 'self::first',
+            'SETRANGE' => 'self::first',
+            'GETRANGE' => 'self::first',
+            'SETBIT' => 'self::first',
+            'GETBIT' => 'self::first',
+            'RPUSHX' => 'self::first',
+            'LPUSHX' => 'self::first',
+            'LINSERT' => 'self::first',
+            'BRPOPLPUSH' => 'self::skipLast',
+            'ZREVRANGEBYSCORE' => 'self::first',
+            'WATCH' => 'self::all',
             /* ---------------- Redis 2.6 ---------------- */
-            'PTTL'                      => 'self::first',
-            'PEXPIRE'                   => 'self::first',
-            'PEXPIREAT'                 => 'self::first',
-            'PSETEX'                    => 'self::first',
-            'INCRBYFLOAT'               => 'self::first',
-            'BITOP'                     => 'self::skipFirst',
-            'BITCOUNT'                  => 'self::first',
-            'HINCRBYFLOAT'              => 'self::first',
-            'EVAL'                      => 'self::evalKeys',
-            'EVALSHA'                   => 'self::evalKeys',
-            'MIGRATE'                   => 'self::migrate',
+            'PTTL' => 'self::first',
+            'PEXPIRE' => 'self::first',
+            'PEXPIREAT' => 'self::first',
+            'PSETEX' => 'self::first',
+            'INCRBYFLOAT' => 'self::first',
+            'BITOP' => 'self::skipFirst',
+            'BITCOUNT' => 'self::first',
+            'HINCRBYFLOAT' => 'self::first',
+            'EVAL' => 'self::evalKeys',
+            'EVALSHA' => 'self::evalKeys',
+            'MIGRATE' => 'self::migrate',
             /* ---------------- Redis 2.8 ---------------- */
-            'SSCAN'                     => 'self::first',
-            'ZSCAN'                     => 'self::first',
-            'HSCAN'                     => 'self::first',
-            'PFADD'                     => 'self::first',
-            'PFCOUNT'                   => 'self::all',
-            'PFMERGE'                   => 'self::all',
-            'ZLEXCOUNT'                 => 'self::first',
-            'ZRANGEBYLEX'               => 'self::first',
-            'ZREMRANGEBYLEX'            => 'self::first',
-            'ZREVRANGEBYLEX'            => 'self::first',
-            'BITPOS'                    => 'self::first',
+            'SSCAN' => 'self::first',
+            'ZSCAN' => 'self::first',
+            'HSCAN' => 'self::first',
+            'PFADD' => 'self::first',
+            'PFCOUNT' => 'self::all',
+            'PFMERGE' => 'self::all',
+            'ZLEXCOUNT' => 'self::first',
+            'ZRANGEBYLEX' => 'self::first',
+            'ZREMRANGEBYLEX' => 'self::first',
+            'ZREVRANGEBYLEX' => 'self::first',
+            'BITPOS' => 'self::first',
         );
     }
 
@@ -221,7 +221,7 @@ class KeyPrefixProcessor implements ProcessorInterface
 
         if (!is_callable($callback)) {
             throw new InvalidArgumentException(
-                "Callback must be a valid callable object or NULL"
+                'Callback must be a valid callable object or NULL'
             );
         }
 
@@ -297,7 +297,7 @@ class KeyPrefixProcessor implements ProcessorInterface
         if ($arguments = $command->getArguments()) {
             $length = count($arguments);
 
-            for ($i = 1; $i < $length; $i++) {
+            for ($i = 1; $i < $length; ++$i) {
                 $arguments[$i] = "$prefix{$arguments[$i]}";
             }
 
@@ -316,7 +316,7 @@ class KeyPrefixProcessor implements ProcessorInterface
         if ($arguments = $command->getArguments()) {
             $length = count($arguments);
 
-            for ($i = 0; $i < $length - 1; $i++) {
+            for ($i = 0; $i < $length - 1; ++$i) {
                 $arguments[$i] = "$prefix{$arguments[$i]}";
             }
 
@@ -336,7 +336,7 @@ class KeyPrefixProcessor implements ProcessorInterface
             $arguments[0] = "$prefix{$arguments[0]}";
 
             if (($count = count($arguments)) > 1) {
-                for ($i = 1; $i < $count; $i++) {
+                for ($i = 1; $i < $count; ++$i) {
                     switch ($arguments[$i]) {
                         case 'BY':
                         case 'STORE':
@@ -370,7 +370,7 @@ class KeyPrefixProcessor implements ProcessorInterface
     public static function evalKeys(CommandInterface $command, $prefix)
     {
         if ($arguments = $command->getArguments()) {
-            for ($i = 2; $i < $arguments[1] + 2; $i++) {
+            for ($i = 2; $i < $arguments[1] + 2; ++$i) {
                 $arguments[$i] = "$prefix{$arguments[$i]}";
             }
 
@@ -390,7 +390,7 @@ class KeyPrefixProcessor implements ProcessorInterface
             $arguments[0] = "$prefix{$arguments[0]}";
             $length = ((int) $arguments[1]) + 2;
 
-            for ($i = 2; $i < $length; $i++) {
+            for ($i = 2; $i < $length; ++$i) {
                 $arguments[$i] = "$prefix{$arguments[$i]}";
             }
 

+ 2 - 2
src/Command/Processor/ProcessorChain.php

@@ -58,7 +58,7 @@ class ProcessorChain implements ArrayAccess, ProcessorInterface
      */
     public function process(CommandInterface $command)
     {
-        for ($i = 0; $i < $count = count($this->processors); $i++) {
+        for ($i = 0; $i < $count = count($this->processors); ++$i) {
             $this->processors[$i]->process($command);
         }
     }
@@ -114,7 +114,7 @@ class ProcessorChain implements ArrayAccess, ProcessorInterface
     {
         if (!$processor instanceof ProcessorInterface) {
             throw new InvalidArgumentException(
-                "A processor chain accepts only instances of ".
+                'A processor chain accepts only instances of '.
                 "'Predis\Command\Processor\ProcessorInterface'."
             );
         }

+ 1 - 0
src/Command/PubSubPublish.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/publish
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class PubSubPublish extends Command

+ 2 - 1
src/Command/PubSubPubsub.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/pubsub
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class PubSubPubsub extends Command
@@ -51,7 +52,7 @@ class PubSubPubsub extends Command
         $processed = array();
         $count = count($channels);
 
-        for ($i = 0; $i < $count; $i++) {
+        for ($i = 0; $i < $count; ++$i) {
             $processed[$channels[$i]] = $channels[++$i];
         }
 

+ 1 - 0
src/Command/PubSubSubscribe.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/subscribe
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class PubSubSubscribe extends Command

+ 1 - 0
src/Command/PubSubSubscribeByPattern.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/psubscribe
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class PubSubSubscribeByPattern extends PubSubSubscribe

+ 1 - 0
src/Command/PubSubUnsubscribe.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/unsubscribe
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class PubSubUnsubscribe extends Command

+ 1 - 0
src/Command/PubSubUnsubscribeByPattern.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/punsubscribe
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class PubSubUnsubscribeByPattern extends PubSubUnsubscribe

+ 1 - 0
src/Command/ScriptCommand.php

@@ -16,6 +16,7 @@ namespace Predis\Command;
  * on Lua scripting with EVAL and EVALSHA.
  *
  * @link http://redis.io/commands/eval
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 abstract class ScriptCommand extends ServerEvalSHA

+ 1 - 0
src/Command/ServerBackgroundRewriteAOF.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/bgrewriteaof
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerBackgroundRewriteAOF extends Command

+ 1 - 0
src/Command/ServerBackgroundSave.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/bgsave
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerBackgroundSave extends Command

+ 1 - 0
src/Command/ServerClient.php

@@ -16,6 +16,7 @@ namespace Predis\Command;
  * @link http://redis.io/commands/client-kill
  * @link http://redis.io/commands/client-getname
  * @link http://redis.io/commands/client-setname
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerClient extends Command

+ 1 - 0
src/Command/ServerCommand.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/command
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerCommand extends Command

+ 2 - 1
src/Command/ServerConfig.php

@@ -16,6 +16,7 @@ namespace Predis\Command;
  * @link http://redis.io/commands/config-get
  * @link http://redis.io/commands/config-resetstat
  * @link http://redis.io/commands/config-rewrite
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerConfig extends Command
@@ -36,7 +37,7 @@ class ServerConfig extends Command
         if (is_array($data)) {
             $result = array();
 
-            for ($i = 0; $i < count($data); $i++) {
+            for ($i = 0; $i < count($data); ++$i) {
                 $result[$data[$i]] = $data[++$i];
             }
 

+ 1 - 0
src/Command/ServerDatabaseSize.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/dbsize
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerDatabaseSize extends Command

+ 1 - 0
src/Command/ServerEval.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/eval
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerEval extends Command

+ 1 - 0
src/Command/ServerEvalSHA.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/evalsha
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerEvalSHA extends ServerEval

+ 1 - 0
src/Command/ServerFlushAll.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/flushall
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerFlushAll extends Command

+ 1 - 0
src/Command/ServerFlushDatabase.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/flushdb
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerFlushDatabase extends Command

+ 2 - 1
src/Command/ServerInfo.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/info
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerInfo extends Command
@@ -30,7 +31,7 @@ class ServerInfo extends Command
      */
     public function parseResponse($data)
     {
-        $info      = array();
+        $info = array();
         $infoLines = preg_split('/\r?\n/', $data);
 
         foreach ($infoLines as $row) {

+ 1 - 0
src/Command/ServerInfoV26x.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/info
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerInfoV26x extends ServerInfo

+ 1 - 0
src/Command/ServerLastSave.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/lastsave
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerLastSave extends Command

+ 1 - 0
src/Command/ServerMonitor.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/monitor
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerMonitor extends Command

+ 1 - 0
src/Command/ServerObject.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/object
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerObject extends Command

+ 1 - 0
src/Command/ServerSave.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/save
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerSave extends Command

+ 1 - 0
src/Command/ServerScript.php

@@ -13,6 +13,7 @@ namespace Predis\Command;
 
 /**
  * @link http://redis.io/commands/script
+ *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
 class ServerScript extends Command

Some files were not shown because too many files changed in this diff