Parcourir la source

Rename command classes using command ID as name.

Some notable exceptions are EVAL and ECHO because having these names
as class names would raise a syntax error.
Daniele Alessandri il y a 8 ans
Parent
commit
4b47639f9e
100 fichiers modifiés avec 355 ajouts et 315 suppressions
  1. 1 1
      CHANGELOG.md
  2. 14 11
      bin/create-command-test
  3. 2 2
      src/Command/Redis/APPEND.php
  4. 2 2
      src/Command/Redis/AUTH.php
  5. 2 2
      src/Command/Redis/BGREWRITEAOF.php
  6. 2 2
      src/Command/Redis/BGSAVE.php
  7. 2 2
      src/Command/Redis/BITCOUNT.php
  8. 2 2
      src/Command/Redis/BITFIELD.php
  9. 2 2
      src/Command/Redis/BITOP.php
  10. 2 2
      src/Command/Redis/BITPOS.php
  11. 2 2
      src/Command/Redis/BLPOP.php
  12. 43 0
      src/Command/Redis/BRPOP.php
  13. 2 2
      src/Command/Redis/BRPOPLPUSH.php
  14. 2 2
      src/Command/Redis/CLIENT.php
  15. 2 2
      src/Command/Redis/COMMAND.php
  16. 2 2
      src/Command/Redis/CONFIG.php
  17. 2 2
      src/Command/Redis/DBSIZE.php
  18. 2 2
      src/Command/Redis/DECR.php
  19. 2 2
      src/Command/Redis/DECRBY.php
  20. 2 2
      src/Command/Redis/DEL.php
  21. 2 2
      src/Command/Redis/DISCARD.php
  22. 2 2
      src/Command/Redis/DUMP.php
  23. 2 2
      src/Command/Redis/ECHO_.php
  24. 1 3
      src/Command/Redis/EVALSHA.php
  25. 2 2
      src/Command/Redis/EVAL_.php
  26. 2 2
      src/Command/Redis/EXEC.php
  27. 2 2
      src/Command/Redis/EXISTS.php
  28. 2 2
      src/Command/Redis/EXPIRE.php
  29. 2 2
      src/Command/Redis/EXPIREAT.php
  30. 2 2
      src/Command/Redis/FLUSHALL.php
  31. 2 2
      src/Command/Redis/FLUSHDB.php
  32. 2 2
      src/Command/Redis/GEOADD.php
  33. 2 2
      src/Command/Redis/GEODIST.php
  34. 2 2
      src/Command/Redis/GEOHASH.php
  35. 2 2
      src/Command/Redis/GEOPOS.php
  36. 2 2
      src/Command/Redis/GEORADIUS.php
  37. 1 3
      src/Command/Redis/GEORADIUSBYMEMBER.php
  38. 2 2
      src/Command/Redis/GET.php
  39. 2 2
      src/Command/Redis/GETBIT.php
  40. 2 2
      src/Command/Redis/GETRANGE.php
  41. 2 2
      src/Command/Redis/GETSET.php
  42. 2 2
      src/Command/Redis/HDEL.php
  43. 2 2
      src/Command/Redis/HEXISTS.php
  44. 2 2
      src/Command/Redis/HGET.php
  45. 2 2
      src/Command/Redis/HGETALL.php
  46. 2 2
      src/Command/Redis/HINCRBY.php
  47. 2 2
      src/Command/Redis/HINCRBYFLOAT.php
  48. 2 2
      src/Command/Redis/HKEYS.php
  49. 2 2
      src/Command/Redis/HLEN.php
  50. 2 2
      src/Command/Redis/HMGET.php
  51. 2 2
      src/Command/Redis/HMSET.php
  52. 2 2
      src/Command/Redis/HSCAN.php
  53. 2 2
      src/Command/Redis/HSET.php
  54. 2 2
      src/Command/Redis/HSETNX.php
  55. 2 2
      src/Command/Redis/HSTRLEN.php
  56. 2 2
      src/Command/Redis/HVALS.php
  57. 2 2
      src/Command/Redis/INCR.php
  58. 2 2
      src/Command/Redis/INCRBY.php
  59. 2 2
      src/Command/Redis/INCRBYFLOAT.php
  60. 2 2
      src/Command/Redis/INFO.php
  61. 2 2
      src/Command/Redis/KEYS.php
  62. 2 2
      src/Command/Redis/LASTSAVE.php
  63. 2 2
      src/Command/Redis/LINDEX.php
  64. 2 2
      src/Command/Redis/LINSERT.php
  65. 2 2
      src/Command/Redis/LLEN.php
  66. 2 2
      src/Command/Redis/LPOP.php
  67. 40 0
      src/Command/Redis/LPUSH.php
  68. 2 2
      src/Command/Redis/LPUSHX.php
  69. 2 2
      src/Command/Redis/LRANGE.php
  70. 2 2
      src/Command/Redis/LREM.php
  71. 2 2
      src/Command/Redis/LSET.php
  72. 2 2
      src/Command/Redis/LTRIM.php
  73. 0 30
      src/Command/Redis/ListPopLastBlocking.php
  74. 0 30
      src/Command/Redis/ListPushHead.php
  75. 2 2
      src/Command/Redis/MGET.php
  76. 2 2
      src/Command/Redis/MIGRATE.php
  77. 2 2
      src/Command/Redis/MONITOR.php
  78. 2 2
      src/Command/Redis/MOVE.php
  79. 2 2
      src/Command/Redis/MSET.php
  80. 1 3
      src/Command/Redis/MSETNX.php
  81. 2 2
      src/Command/Redis/MULTI.php
  82. 2 2
      src/Command/Redis/OBJECT.php
  83. 2 2
      src/Command/Redis/PERSIST.php
  84. 2 2
      src/Command/Redis/PEXPIRE.php
  85. 2 2
      src/Command/Redis/PEXPIREAT.php
  86. 2 2
      src/Command/Redis/PFADD.php
  87. 2 2
      src/Command/Redis/PFCOUNT.php
  88. 2 2
      src/Command/Redis/PFMERGE.php
  89. 2 2
      src/Command/Redis/PING.php
  90. 2 2
      src/Command/Redis/PSETEX.php
  91. 40 0
      src/Command/Redis/PSUBSCRIBE.php
  92. 2 2
      src/Command/Redis/PTTL.php
  93. 2 2
      src/Command/Redis/PUBLISH.php
  94. 2 2
      src/Command/Redis/PUBSUB.php
  95. 40 0
      src/Command/Redis/PUNSUBSCRIBE.php
  96. 0 30
      src/Command/Redis/PubSubSubscribeByPattern.php
  97. 0 30
      src/Command/Redis/PubSubUnsubscribeByPattern.php
  98. 2 2
      src/Command/Redis/QUIT.php
  99. 2 2
      src/Command/Redis/RANDOMKEY.php
  100. 2 2
      src/Command/Redis/RENAME.php

+ 1 - 1
CHANGELOG.md

@@ -11,7 +11,7 @@ v2.0.0 (201x-xx-xx)
 - Changed the signature for the constructor of `Predis\Command\RawCommand`.
 
 - Classes for Redis commands have been moved into the new `Predis\Command\Redis`
-  namespace.
+  namespace and each class name mirrors the respective Redis command ID.
 
 
 v1.1.0 (2016-06-02)

+ 14 - 11
bin/create-command-test

@@ -45,6 +45,11 @@ class CommandTestCaseGenerator
         if (!isset($options['class'])) {
             throw new RuntimeException("Missing 'class' option.");
         }
+
+        if (!isset($options['realm'])) {
+            throw new RuntimeException("Missing 'realm' option.");
+        }
+
         $this->options = $options;
     }
 
@@ -92,6 +97,10 @@ class CommandTestCaseGenerator
             throw new RuntimeException("Missing 'class' option.");
         }
 
+        if (!isset($options['realm'])) {
+            throw new RuntimeException("Missing 'realm' option.");
+        }
+
         $options['fqn'] = "Predis\\Command\\Redis\\{$options['class']}";
         $options['path'] = "Command/Redis/{$options['class']}.php";
 
@@ -101,7 +110,7 @@ class CommandTestCaseGenerator
         }
 
         if (!isset($options['output'])) {
-            $options['output'] = sprintf("%s/%s", $options['tests'], str_replace('.php', 'Test.php', $options['path']));
+            $options['output'] = sprintf("%s/%s", $options['tests'], str_replace('.php', '_Test.php', $options['path']));
         }
 
         return new self($options);
@@ -109,18 +118,11 @@ class CommandTestCaseGenerator
 
     protected function getTestRealm()
     {
-        if (isset($this->options['realm'])) {
-            if (!$this->options['realm']) {
-                throw new RuntimeException('Invalid value for realm has been sepcified (empty).');
-            }
-            return $this->options['realm'];
+        if (empty($this->options['realm'])) {
+            throw new RuntimeException('Invalid value for realm has been sepcified (empty).');
         }
 
-        $fqnParts = explode('\\', $this->options['fqn']);
-        $class = array_pop($fqnParts);
-        list($realm,) = preg_split('/([[:upper:]][[:lower:]]+)/', $class, 2, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
-
-        return strtolower($realm);
+        return $this->options['realm'];
     }
 
     public function generate()
@@ -130,6 +132,7 @@ class CommandTestCaseGenerator
         if (!$reflection->isInstantiable()) {
             throw new RuntimeException("Class $class must be instantiable, abstract classes or interfaces are not allowed.");
         }
+
         if (!$reflection->implementsInterface('Predis\Command\CommandInterface')) {
             throw new RuntimeException("Class $class must implement Predis\Command\CommandInterface.");
         }

+ 2 - 2
src/Command/Redis/StringAppend.php → src/Command/Redis/APPEND.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/append
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringAppend extends Command
+class APPEND extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ConnectionAuth.php → src/Command/Redis/AUTH.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/auth
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ConnectionAuth extends Command
+class AUTH extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerBackgroundRewriteAOF.php → src/Command/Redis/BGREWRITEAOF.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/bgrewriteaof
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerBackgroundRewriteAOF extends Command
+class BGREWRITEAOF extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerBackgroundSave.php → src/Command/Redis/BGSAVE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/bgsave
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerBackgroundSave extends Command
+class BGSAVE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringBitCount.php → src/Command/Redis/BITCOUNT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/bitcount
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringBitCount extends Command
+class BITCOUNT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringBitField.php → src/Command/Redis/BITFIELD.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/bitfield
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringBitField extends Command
+class BITFIELD extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringBitOp.php → src/Command/Redis/BITOP.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/bitop
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringBitOp extends Command
+class BITOP extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringBitPos.php → src/Command/Redis/BITPOS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/bitpos
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringBitPos extends Command
+class BITPOS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListPopFirstBlocking.php → src/Command/Redis/BLPOP.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/blpop
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListPopFirstBlocking extends Command
+class BLPOP extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 43 - 0
src/Command/Redis/BRPOP.php

@@ -0,0 +1,43 @@
+<?php
+
+/*
+ * This file is part of the Predis package.
+ *
+ * (c) Daniele Alessandri <suppakilla@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Predis\Command\Redis;
+
+use Predis\Command\Command as RedisCommand;
+
+/**
+ * @link http://redis.io/commands/brpop
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
+class BRPOP extends RedisCommand
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getId()
+    {
+        return 'BRPOP';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setArguments(array $arguments)
+    {
+        if (count($arguments) === 2 && is_array($arguments[0])) {
+            list($arguments, $timeout) = $arguments;
+            array_push($arguments, $timeout);
+        }
+
+        parent::setArguments($arguments);
+    }
+}

+ 2 - 2
src/Command/Redis/ListPopLastPushHeadBlocking.php → src/Command/Redis/BRPOPLPUSH.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/brpoplpush
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListPopLastPushHeadBlocking extends Command
+class BRPOPLPUSH extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerClient.php → src/Command/Redis/CLIENT.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/client-list
@@ -21,7 +21,7 @@ use Predis\Command\Command;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerClient extends Command
+class CLIENT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerCommand.php → src/Command/Redis/COMMAND.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as BaseCommand;
 
 /**
  * @link http://redis.io/commands/command
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerCommand extends Command
+class COMMAND extends BaseCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerConfig.php → src/Command/Redis/CONFIG.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/config-set
@@ -21,7 +21,7 @@ use Predis\Command\Command;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerConfig extends Command
+class CONFIG extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerDatabaseSize.php → src/Command/Redis/DBSIZE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/dbsize
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerDatabaseSize extends Command
+class DBSIZE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringDecrement.php → src/Command/Redis/DECR.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/decr
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringDecrement extends Command
+class DECR extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringDecrementBy.php → src/Command/Redis/DECRBY.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/decrby
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringDecrementBy extends Command
+class DECRBY extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyDelete.php → src/Command/Redis/DEL.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/del
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyDelete extends Command
+class DEL extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/TransactionDiscard.php → src/Command/Redis/DISCARD.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/discard
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class TransactionDiscard extends Command
+class DISCARD extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyDump.php → src/Command/Redis/DUMP.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/dump
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyDump extends Command
+class DUMP extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ConnectionEcho.php → src/Command/Redis/ECHO_.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/echo
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ConnectionEcho extends Command
+class ECHO_ extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 1 - 3
src/Command/Redis/ServerEvalSHA.php → src/Command/Redis/EVALSHA.php

@@ -11,14 +11,12 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
-
 /**
  * @link http://redis.io/commands/evalsha
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerEvalSHA extends ServerEval
+class EVALSHA extends EVAL_
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerEval.php → src/Command/Redis/EVAL_.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/eval
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerEval extends Command
+class EVAL_ extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/TransactionExec.php → src/Command/Redis/EXEC.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/exec
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class TransactionExec extends Command
+class EXEC extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyExists.php → src/Command/Redis/EXISTS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/exists
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyExists extends Command
+class EXISTS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyExpire.php → src/Command/Redis/EXPIRE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/expire
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyExpire extends Command
+class EXPIRE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyExpireAt.php → src/Command/Redis/EXPIREAT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/expireat
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyExpireAt extends Command
+class EXPIREAT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerFlushAll.php → src/Command/Redis/FLUSHALL.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/flushall
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerFlushAll extends Command
+class FLUSHALL extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerFlushDatabase.php → src/Command/Redis/FLUSHDB.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/flushdb
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerFlushDatabase extends Command
+class FLUSHDB extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/GeospatialGeoAdd.php → src/Command/Redis/GEOADD.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/geoadd
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class GeospatialGeoAdd extends Command
+class GEOADD extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/GeospatialGeoDist.php → src/Command/Redis/GEODIST.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/geodist
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class GeospatialGeoDist extends Command
+class GEODIST extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/GeospatialGeoHash.php → src/Command/Redis/GEOHASH.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/geohash
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class GeospatialGeoHash extends Command
+class GEOHASH extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/GeospatialGeoPos.php → src/Command/Redis/GEOPOS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/geopos
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class GeospatialGeoPos extends Command
+class GEOPOS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/GeospatialGeoRadius.php → src/Command/Redis/GEORADIUS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/georadius
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class GeospatialGeoRadius extends Command
+class GEORADIUS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 1 - 3
src/Command/Redis/GeospatialGeoRadiusByMember.php → src/Command/Redis/GEORADIUSBYMEMBER.php

@@ -11,14 +11,12 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
-
 /**
  * @link http://redis.io/commands/georadiusbymember
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class GeospatialGeoRadiusByMember extends GeospatialGeoRadius
+class GEORADIUSBYMEMBER extends GEORADIUS
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringGet.php → src/Command/Redis/GET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/get
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringGet extends Command
+class GET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringGetBit.php → src/Command/Redis/GETBIT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/getbit
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringGetBit extends Command
+class GETBIT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringGetRange.php → src/Command/Redis/GETRANGE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/getrange
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringGetRange extends Command
+class GETRANGE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringGetSet.php → src/Command/Redis/GETSET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/getset
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringGetSet extends Command
+class GETSET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashDelete.php → src/Command/Redis/HDEL.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hdel
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashDelete extends Command
+class HDEL extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashExists.php → src/Command/Redis/HEXISTS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hexists
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashExists extends Command
+class HEXISTS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashGet.php → src/Command/Redis/HGET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hget
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashGet extends Command
+class HGET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashGetAll.php → src/Command/Redis/HGETALL.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hgetall
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashGetAll extends Command
+class HGETALL extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashIncrementBy.php → src/Command/Redis/HINCRBY.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hincrby
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashIncrementBy extends Command
+class HINCRBY extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashIncrementByFloat.php → src/Command/Redis/HINCRBYFLOAT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hincrbyfloat
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashIncrementByFloat extends Command
+class HINCRBYFLOAT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashKeys.php → src/Command/Redis/HKEYS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hkeys
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashKeys extends Command
+class HKEYS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashLength.php → src/Command/Redis/HLEN.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hlen
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashLength extends Command
+class HLEN extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashGetMultiple.php → src/Command/Redis/HMGET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hmget
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashGetMultiple extends Command
+class HMGET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashSetMultiple.php → src/Command/Redis/HMSET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hmset
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashSetMultiple extends Command
+class HMSET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashScan.php → src/Command/Redis/HSCAN.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hscan
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashScan extends Command
+class HSCAN extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashSet.php → src/Command/Redis/HSET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hset
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashSet extends Command
+class HSET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashSetPreserve.php → src/Command/Redis/HSETNX.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hsetnx
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashSetPreserve extends Command
+class HSETNX extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashStringLength.php → src/Command/Redis/HSTRLEN.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hstrlen
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashStringLength extends Command
+class HSTRLEN extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HashValues.php → src/Command/Redis/HVALS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/hvals
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HashValues extends Command
+class HVALS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringIncrement.php → src/Command/Redis/INCR.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/incr
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringIncrement extends Command
+class INCR extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringIncrementBy.php → src/Command/Redis/INCRBY.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/incrby
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringIncrementBy extends Command
+class INCRBY extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringIncrementByFloat.php → src/Command/Redis/INCRBYFLOAT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/incrbyfloat
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringIncrementByFloat extends Command
+class INCRBYFLOAT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerInfo.php → src/Command/Redis/INFO.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/info
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerInfo extends Command
+class INFO extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyKeys.php → src/Command/Redis/KEYS.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/keys
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyKeys extends Command
+class KEYS extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerLastSave.php → src/Command/Redis/LASTSAVE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lastsave
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerLastSave extends Command
+class LASTSAVE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListIndex.php → src/Command/Redis/LINDEX.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lindex
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListIndex extends Command
+class LINDEX extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListInsert.php → src/Command/Redis/LINSERT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/linsert
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListInsert extends Command
+class LINSERT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListLength.php → src/Command/Redis/LLEN.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/llen
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListLength extends Command
+class LLEN extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListPopFirst.php → src/Command/Redis/LPOP.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lpop
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListPopFirst extends Command
+class LPOP extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 40 - 0
src/Command/Redis/LPUSH.php

@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * This file is part of the Predis package.
+ *
+ * (c) Daniele Alessandri <suppakilla@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Predis\Command\Redis;
+
+use Predis\Command\Command as RedisCommand;
+
+/**
+ * @link http://redis.io/commands/lpush
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
+class LPUSH extends RedisCommand
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getId()
+    {
+        return 'LPUSH';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setArguments(array $arguments)
+    {
+        $arguments = self::normalizeVariadic($arguments);
+
+        parent::setArguments($arguments);
+    }
+}

+ 2 - 2
src/Command/Redis/ListPushHeadX.php → src/Command/Redis/LPUSHX.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lpushx
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListPushHeadX extends Command
+class LPUSHX extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListRange.php → src/Command/Redis/LRANGE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lrange
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListRange extends Command
+class LRANGE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListRemove.php → src/Command/Redis/LREM.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lrem
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListRemove extends Command
+class LREM extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListSet.php → src/Command/Redis/LSET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/lset
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListSet extends Command
+class LSET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ListTrim.php → src/Command/Redis/LTRIM.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/ltrim
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ListTrim extends Command
+class LTRIM extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 0 - 30
src/Command/Redis/ListPopLastBlocking.php

@@ -1,30 +0,0 @@
-<?php
-
-/*
- * This file is part of the Predis package.
- *
- * (c) Daniele Alessandri <suppakilla@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Predis\Command\Redis;
-
-use Predis\Command\Command;
-
-/**
- * @link http://redis.io/commands/brpop
- *
- * @author Daniele Alessandri <suppakilla@gmail.com>
- */
-class ListPopLastBlocking extends ListPopFirstBlocking
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getId()
-    {
-        return 'BRPOP';
-    }
-}

+ 0 - 30
src/Command/Redis/ListPushHead.php

@@ -1,30 +0,0 @@
-<?php
-
-/*
- * This file is part of the Predis package.
- *
- * (c) Daniele Alessandri <suppakilla@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Predis\Command\Redis;
-
-use Predis\Command\Command;
-
-/**
- * @link http://redis.io/commands/lpush
- *
- * @author Daniele Alessandri <suppakilla@gmail.com>
- */
-class ListPushHead extends ListPushTail
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getId()
-    {
-        return 'LPUSH';
-    }
-}

+ 2 - 2
src/Command/Redis/StringGetMultiple.php → src/Command/Redis/MGET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/mget
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringGetMultiple extends Command
+class MGET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyMigrate.php → src/Command/Redis/MIGRATE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/migrate
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyMigrate extends Command
+class MIGRATE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerMonitor.php → src/Command/Redis/MONITOR.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/monitor
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerMonitor extends Command
+class MONITOR extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyMove.php → src/Command/Redis/MOVE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/move
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyMove extends Command
+class MOVE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringSetMultiple.php → src/Command/Redis/MSET.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/mset
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringSetMultiple extends Command
+class MSET extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 1 - 3
src/Command/Redis/StringSetMultiplePreserve.php → src/Command/Redis/MSETNX.php

@@ -11,14 +11,12 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
-
 /**
  * @link http://redis.io/commands/msetnx
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringSetMultiplePreserve extends StringSetMultiple
+class MSETNX extends MSET
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/TransactionMulti.php → src/Command/Redis/MULTI.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/multi
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class TransactionMulti extends Command
+class MULTI extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ServerObject.php → src/Command/Redis/OBJECT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/object
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerObject extends Command
+class OBJECT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyPersist.php → src/Command/Redis/PERSIST.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/persist
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyPersist extends Command
+class PERSIST extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyPreciseExpire.php → src/Command/Redis/PEXPIRE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pexpire
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyPreciseExpire extends KeyExpire
+class PEXPIRE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyPreciseExpireAt.php → src/Command/Redis/PEXPIREAT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pexpireat
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyPreciseExpireAt extends KeyExpireAt
+class PEXPIREAT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HyperLogLogAdd.php → src/Command/Redis/PFADD.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pfadd
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HyperLogLogAdd extends Command
+class PFADD extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HyperLogLogCount.php → src/Command/Redis/PFCOUNT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pfcount
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HyperLogLogCount extends Command
+class PFCOUNT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/HyperLogLogMerge.php → src/Command/Redis/PFMERGE.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pfmerge
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class HyperLogLogMerge extends Command
+class PFMERGE extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/ConnectionPing.php → src/Command/Redis/PING.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/ping
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ConnectionPing extends Command
+class PING extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/StringPreciseSetExpire.php → src/Command/Redis/PSETEX.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/psetex
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class StringPreciseSetExpire extends StringSetExpire
+class PSETEX extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 40 - 0
src/Command/Redis/PSUBSCRIBE.php

@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * This file is part of the Predis package.
+ *
+ * (c) Daniele Alessandri <suppakilla@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Predis\Command\Redis;
+
+use Predis\Command\Command as RedisCommand;
+
+/**
+ * @link http://redis.io/commands/psubscribe
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
+class PSUBSCRIBE extends RedisCommand
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getId()
+    {
+        return 'PSUBSCRIBE';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setArguments(array $arguments)
+    {
+        $arguments = self::normalizeArguments($arguments);
+
+        parent::setArguments($arguments);
+    }
+}

+ 2 - 2
src/Command/Redis/KeyPreciseTimeToLive.php → src/Command/Redis/PTTL.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pttl
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyPreciseTimeToLive extends KeyTimeToLive
+class PTTL extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/PubSubPublish.php → src/Command/Redis/PUBLISH.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/publish
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class PubSubPublish extends Command
+class PUBLISH extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/PubSubPubsub.php → src/Command/Redis/PUBSUB.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/pubsub
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class PubSubPubsub extends Command
+class PUBSUB extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 40 - 0
src/Command/Redis/PUNSUBSCRIBE.php

@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * This file is part of the Predis package.
+ *
+ * (c) Daniele Alessandri <suppakilla@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Predis\Command\Redis;
+
+use Predis\Command\Command as RedisCommand;
+
+/**
+ * @link http://redis.io/commands/punsubscribe
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
+class PUNSUBSCRIBE extends RedisCommand
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getId()
+    {
+        return 'PUNSUBSCRIBE';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setArguments(array $arguments)
+    {
+        $arguments = self::normalizeArguments($arguments);
+
+        parent::setArguments($arguments);
+    }
+}

+ 0 - 30
src/Command/Redis/PubSubSubscribeByPattern.php

@@ -1,30 +0,0 @@
-<?php
-
-/*
- * This file is part of the Predis package.
- *
- * (c) Daniele Alessandri <suppakilla@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Predis\Command\Redis;
-
-use Predis\Command\Command;
-
-/**
- * @link http://redis.io/commands/psubscribe
- *
- * @author Daniele Alessandri <suppakilla@gmail.com>
- */
-class PubSubSubscribeByPattern extends PubSubSubscribe
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getId()
-    {
-        return 'PSUBSCRIBE';
-    }
-}

+ 0 - 30
src/Command/Redis/PubSubUnsubscribeByPattern.php

@@ -1,30 +0,0 @@
-<?php
-
-/*
- * This file is part of the Predis package.
- *
- * (c) Daniele Alessandri <suppakilla@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Predis\Command\Redis;
-
-use Predis\Command\Command;
-
-/**
- * @link http://redis.io/commands/punsubscribe
- *
- * @author Daniele Alessandri <suppakilla@gmail.com>
- */
-class PubSubUnsubscribeByPattern extends PubSubUnsubscribe
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getId()
-    {
-        return 'PUNSUBSCRIBE';
-    }
-}

+ 2 - 2
src/Command/Redis/ConnectionQuit.php → src/Command/Redis/QUIT.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/quit
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ConnectionQuit extends Command
+class QUIT extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyRandom.php → src/Command/Redis/RANDOMKEY.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/randomkey
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyRandom extends Command
+class RANDOMKEY extends RedisCommand
 {
     /**
      * {@inheritdoc}

+ 2 - 2
src/Command/Redis/KeyRename.php → src/Command/Redis/RENAME.php

@@ -11,14 +11,14 @@
 
 namespace Predis\Command\Redis;
 
-use Predis\Command\Command;
+use Predis\Command\Command as RedisCommand;
 
 /**
  * @link http://redis.io/commands/rename
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class KeyRename extends Command
+class RENAME extends RedisCommand
 {
     /**
      * {@inheritdoc}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff