Parcourir la source

[phpdoc] Add API documentation.

This is a starting point to add a documentation of the whole set of APIs and
classes of Predis. The next step will be to actually improve and extend it.
Daniele Alessandri il y a 13 ans
Parent
commit
4e6ed3f26d
100 fichiers modifiés avec 1430 ajouts et 12 suppressions
  1. 16 0
      lib/Predis/Autoloader.php
  2. 175 9
      lib/Predis/Client.php
  3. 5 0
      lib/Predis/ClientException.php
  4. 42 0
      lib/Predis/ClientOptions.php
  5. 67 0
      lib/Predis/Commands/Command.php
  6. 13 0
      lib/Predis/Commands/ConnectionAuth.php
  7. 13 0
      lib/Predis/Commands/ConnectionEcho.php
  8. 16 0
      lib/Predis/Commands/ConnectionPing.php
  9. 13 0
      lib/Predis/Commands/ConnectionQuit.php
  10. 13 0
      lib/Predis/Commands/ConnectionSelect.php
  11. 13 0
      lib/Predis/Commands/HashDelete.php
  12. 10 0
      lib/Predis/Commands/HashExists.php
  13. 7 0
      lib/Predis/Commands/HashGet.php
  14. 10 0
      lib/Predis/Commands/HashGetAll.php
  15. 10 0
      lib/Predis/Commands/HashGetMultiple.php
  16. 7 0
      lib/Predis/Commands/HashIncrementBy.php
  17. 7 0
      lib/Predis/Commands/HashKeys.php
  18. 7 0
      lib/Predis/Commands/HashLength.php
  19. 12 1
      lib/Predis/Commands/HashSet.php
  20. 10 0
      lib/Predis/Commands/HashSetMultiple.php
  21. 10 0
      lib/Predis/Commands/HashSetPreserve.php
  22. 7 0
      lib/Predis/Commands/HashValues.php
  23. 42 0
      lib/Predis/Commands/ICommand.php
  24. 16 0
      lib/Predis/Commands/KeyDelete.php
  25. 10 0
      lib/Predis/Commands/KeyExists.php
  26. 10 0
      lib/Predis/Commands/KeyExpire.php
  27. 10 0
      lib/Predis/Commands/KeyExpireAt.php
  28. 10 0
      lib/Predis/Commands/KeyKeys.php
  29. 7 0
      lib/Predis/Commands/KeyKeysV12x.php
  30. 13 0
      lib/Predis/Commands/KeyMove.php
  31. 10 0
      lib/Predis/Commands/KeyPersist.php
  32. 13 0
      lib/Predis/Commands/KeyRandom.php
  33. 13 0
      lib/Predis/Commands/KeyRename.php
  34. 10 0
      lib/Predis/Commands/KeyRenamePreserve.php
  35. 13 0
      lib/Predis/Commands/KeySort.php
  36. 7 0
      lib/Predis/Commands/KeyTimeToLive.php
  37. 7 0
      lib/Predis/Commands/KeyType.php
  38. 7 0
      lib/Predis/Commands/ListIndex.php
  39. 7 0
      lib/Predis/Commands/ListInsert.php
  40. 7 0
      lib/Predis/Commands/ListLength.php
  41. 7 0
      lib/Predis/Commands/ListPopFirst.php
  42. 13 0
      lib/Predis/Commands/ListPopFirstBlocking.php
  43. 7 0
      lib/Predis/Commands/ListPopLast.php
  44. 7 0
      lib/Predis/Commands/ListPopLastBlocking.php
  45. 13 0
      lib/Predis/Commands/ListPopLastPushHead.php
  46. 13 0
      lib/Predis/Commands/ListPopLastPushHeadBlocking.php
  47. 7 0
      lib/Predis/Commands/ListPushHead.php
  48. 7 0
      lib/Predis/Commands/ListPushHeadX.php
  49. 10 0
      lib/Predis/Commands/ListPushTail.php
  50. 7 0
      lib/Predis/Commands/ListPushTailX.php
  51. 7 0
      lib/Predis/Commands/ListRange.php
  52. 7 0
      lib/Predis/Commands/ListRemove.php
  53. 7 0
      lib/Predis/Commands/ListSet.php
  54. 7 0
      lib/Predis/Commands/ListTrim.php
  55. 19 0
      lib/Predis/Commands/PrefixHelpers.php
  56. 10 0
      lib/Predis/Commands/Processors/ICommandProcessor.php
  57. 24 2
      lib/Predis/Commands/Processors/ICommandProcessorChain.php
  58. 16 0
      lib/Predis/Commands/Processors/IProcessingSupport.php
  59. 22 0
      lib/Predis/Commands/Processors/KeyPrefixProcessor.php
  60. 42 0
      lib/Predis/Commands/Processors/ProcessorChain.php
  61. 10 0
      lib/Predis/Commands/PubSubPublish.php
  62. 16 0
      lib/Predis/Commands/PubSubSubscribe.php
  63. 7 0
      lib/Predis/Commands/PubSubSubscribeByPattern.php
  64. 13 0
      lib/Predis/Commands/PubSubUnsubscribe.php
  65. 7 0
      lib/Predis/Commands/PubSubUnsubscribeByPattern.php
  66. 23 0
      lib/Predis/Commands/ScriptedCommand.php
  67. 16 0
      lib/Predis/Commands/ServerBackgroundRewriteAOF.php
  68. 16 0
      lib/Predis/Commands/ServerBackgroundSave.php
  69. 23 0
      lib/Predis/Commands/ServerClient.php
  70. 13 0
      lib/Predis/Commands/ServerConfig.php
  71. 13 0
      lib/Predis/Commands/ServerDatabaseSize.php
  72. 13 0
      lib/Predis/Commands/ServerEval.php
  73. 7 0
      lib/Predis/Commands/ServerEvalSHA.php
  74. 13 0
      lib/Predis/Commands/ServerFlushAll.php
  75. 13 0
      lib/Predis/Commands/ServerFlushDatabase.php
  76. 28 0
      lib/Predis/Commands/ServerInfo.php
  77. 7 0
      lib/Predis/Commands/ServerInfoV26x.php
  78. 13 0
      lib/Predis/Commands/ServerLastSave.php
  79. 13 0
      lib/Predis/Commands/ServerMonitor.php
  80. 13 0
      lib/Predis/Commands/ServerObject.php
  81. 13 0
      lib/Predis/Commands/ServerSave.php
  82. 13 0
      lib/Predis/Commands/ServerShutdown.php
  83. 16 0
      lib/Predis/Commands/ServerSlaveOf.php
  84. 13 0
      lib/Predis/Commands/SetAdd.php
  85. 7 0
      lib/Predis/Commands/SetCardinality.php
  86. 10 0
      lib/Predis/Commands/SetDifference.php
  87. 7 0
      lib/Predis/Commands/SetDifferenceStore.php
  88. 16 0
      lib/Predis/Commands/SetIntersection.php
  89. 16 0
      lib/Predis/Commands/SetIntersectionStore.php
  90. 10 0
      lib/Predis/Commands/SetIsMember.php
  91. 7 0
      lib/Predis/Commands/SetMembers.php
  92. 16 0
      lib/Predis/Commands/SetMove.php
  93. 7 0
      lib/Predis/Commands/SetPop.php
  94. 7 0
      lib/Predis/Commands/SetRandomMember.php
  95. 13 0
      lib/Predis/Commands/SetRemove.php
  96. 7 0
      lib/Predis/Commands/SetUnion.php
  97. 7 0
      lib/Predis/Commands/SetUnionStore.php
  98. 7 0
      lib/Predis/Commands/StringAppend.php
  99. 7 0
      lib/Predis/Commands/StringDecrement.php
  100. 7 0
      lib/Predis/Commands/StringDecrementBy.php

+ 16 - 0
lib/Predis/Autoloader.php

@@ -11,22 +11,38 @@
 
 namespace Predis;
 
+/**
+ * Implements a lightweight PSR-0 compliant autoloader.
+ *
+ * @author Eric Naeseth <eric@thumbtack.com>
+ */
 class Autoloader
 {
     private $_baseDir;
     private $_prefix;
 
+    /**
+     * @param string $baseDirectory Base directory where the source files are located.
+     */
     public function __construct($baseDirectory = null)
     {
         $this->_baseDir = $baseDirectory ?: dirname(__FILE__);
         $this->_prefix = __NAMESPACE__ . '\\';
     }
 
+    /**
+     * Registers the autoloader class with the PHP SPL autoloader.
+     */
     public static function register()
     {
         spl_autoload_register(array(new self, 'autoload'));
     }
 
+    /**
+     * Loads a class from a file using its fully qualified name.
+     *
+     * @param string $className Fully qualified name of a class.
+     */
     public function autoload($className)
     {
         if (0 !== strpos($className, $this->_prefix)) {

+ 175 - 9
lib/Predis/Client.php

@@ -19,6 +19,11 @@ use Predis\Profiles\ServerProfile;
 use Predis\Pipeline\PipelineContext;
 use Predis\Transaction\MultiExecContext;
 
+/**
+ * Main class that exposes the most high-level interface to interact with Redis.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class Client
 {
     const VERSION = '0.7.0-dev';
@@ -28,6 +33,12 @@ class Client
     private $_connection;
     private $_connectionFactory;
 
+    /**
+     * Initializes a new client with optional connection parameters and client options.
+     *
+     * @param mixed $parameters Connection parameters for one or multiple Redis servers.
+     * @param mixed $options Options that specify certain behaviours for the client.
+     */
     public function __construct($parameters = null, $options = null)
     {
         $options = $this->filterOptions($options);
@@ -43,6 +54,14 @@ class Client
         $this->_connection = $this->initializeConnection($parameters);
     }
 
+    /**
+     * Creates an instance of Predis\Options\ClientOptions from various types of
+     * parameters (string, array, Predis\Profiles\ServerProfile) or returns the
+     * passed object if its an instance of Predis\Options\ClientOptions.
+     *
+     * @param mixed $options Client options.
+     * @return ClientOptions
+     */
     private function filterOptions($options)
     {
         if ($options === null) {
@@ -64,6 +83,14 @@ class Client
         throw new \InvalidArgumentException("Invalid type for client options");
     }
 
+    /**
+     * Initialize one or multiple connection (cluster) objects from various types of
+     * parameters (string, array) or returns the passed object if it implements the
+     * Predis\Network\IConnection interface.
+     *
+     * @param mixed $parameters Connection parameters or object.
+     * @return IConnection
+     */
     private function initializeConnection($parameters)
     {
         if ($parameters === null) {
@@ -89,6 +116,12 @@ class Client
         return $this->createConnection($parameters);
     }
 
+    /**
+     * Create a new connection to a single Redis server using the provided parameters.
+     *
+     * @param mixed $parameters Connection parameters.
+     * @return IConnectionSingle
+     */
     protected function createConnection($parameters)
     {
         $connection = $this->_connectionFactory->create($parameters);
@@ -107,21 +140,43 @@ class Client
         return $connection;
     }
 
+    /**
+     * Returns the server profile used by the client.
+     *
+     * @return IServerProfile
+     */
     public function getProfile()
     {
         return $this->_profile;
     }
 
+    /**
+     * Returns the client options specified upon client initialization.
+     *
+     * @return ClientOptions
+     */
     public function getOptions()
     {
         return $this->_options;
     }
 
+    /**
+     * Returns the connection factory object used by the client.
+     *
+     * @return IConnectionFactory
+     */
     public function getConnectionFactory()
     {
         return $this->_connectionFactory;
     }
 
+    /**
+     * Returns a new client instance for the specified connection when the client
+     * is connected to a cluster. The new client will use the same options of the
+     * the original instance.
+     *
+     * @return Client
+     */
     public function getClientFor($connectionAlias)
     {
         if (($connection = $this->getConnection($connectionAlias)) === null) {
@@ -131,26 +186,48 @@ class Client
         return new Client($connection, $this->_options);
     }
 
+    /**
+     * Opens the connection to Redis.
+     */
     public function connect()
     {
         $this->_connection->connect();
     }
 
+    /**
+     * Disconnects from Redis.
+     */
     public function disconnect()
     {
         $this->_connection->disconnect();
     }
 
+    /**
+     * Disconnects from Redis. This method is an alias of disconnect().
+     */
     public function quit()
     {
         $this->disconnect();
     }
 
+    /**
+     * Checks if the underlying connection is connected to Redis.
+     *
+     * @return Boolean True means that the connection is open.
+     *                 False means that the connection is closed.
+     */
     public function isConnected()
     {
         return $this->_connection->isConnected();
     }
 
+    /**
+     * Returns the underlying connection instance or, when connected to a cluster,
+     * one of the connection instances identified by its alias.
+     *
+     * @param string $id The alias of a connection when connected to a cluster.
+     * @return IConnection
+     */
     public function getConnection($id = null)
     {
         if (isset($id)) {
@@ -166,22 +243,48 @@ class Client
         return $this->_connection;
     }
 
+    /**
+     * Dinamically invokes a Redis command with the specified arguments.
+     *
+     * @param string $method The name of a Redis command.
+     * @param array $arguments The arguments for the command.
+     * @return mixed
+     */
     public function __call($method, $arguments)
     {
         $command = $this->_profile->createCommand($method, $arguments);
         return $this->_connection->executeCommand($command);
     }
 
+    /**
+     * Creates a new instance of the specified Redis command.
+     *
+     * @param string $method The name of a Redis command.
+     * @param array $arguments The arguments for the command.
+     * @return ICommand
+     */
     public function createCommand($method, $arguments = array())
     {
         return $this->_profile->createCommand($method, $arguments);
     }
 
+    /**
+     * Executes the specified Redis command.
+     *
+     * @param ICommand $command A Redis command.
+     * @return mixed
+     */
     public function executeCommand(ICommand $command)
     {
         return $this->_connection->executeCommand($command);
     }
 
+    /**
+     * Executes the specified Redis command on all the nodes of a cluster.
+     *
+     * @param ICommand $command A Redis command.
+     * @return array
+     */
     public function executeCommandOnShards(ICommand $command)
     {
         if (Helpers::isCluster($this->_connection)) {
@@ -197,6 +300,15 @@ class Client
         return array($this->_connection->executeCommand($command));
     }
 
+    /**
+     * Call the specified initializer method on $this with 0, 1 or 2 arguments.
+     *
+     * TODO: Invert $argv and $initializer.
+     *
+     * @param array $argv Arguments for the initializer.
+     * @param string $initializer The initializer method.
+     * @return mixed
+     */
     private function sharedInitializer($argv, $initializer)
     {
         switch (count($argv)) {
@@ -216,53 +328,107 @@ class Client
         }
     }
 
+    /**
+     * Creates a new pipeline context and returns it, or returns the results of
+     * a pipeline executed inside the optionally provided callable object.
+     *
+     * @param mixed $arg,... Options for the context, a callable object, or both.
+     * @return PipelineContext|array
+     */
     public function pipeline(/* arguments */)
     {
         return $this->sharedInitializer(func_get_args(), 'initPipeline');
     }
 
-    protected function initPipeline(Array $options = null, $pipelineBlock = null)
+    /**
+     * Pipeline context initializer.
+     *
+     * @param array $options Options for the context.
+     * @param mixed $callable Optional callable object used to execute the context.
+     * @return PipelineContext|array
+     */
+    protected function initPipeline(Array $options = null, $callable = null)
     {
         $pipeline = new PipelineContext($this, $options);
-        return $this->pipelineExecute($pipeline, $pipelineBlock);
+        return $this->pipelineExecute($pipeline, $callable);
     }
 
-    private function pipelineExecute(PipelineContext $pipeline, $block)
+    /**
+     * Executes a pipeline context when a callable object is passed.
+     *
+     * @param array $options Options of the context initialization.
+     * @param mixed $callable Optional callable object used to execute the context.
+     * @return PipelineContext|array
+     */
+    private function pipelineExecute(PipelineContext $pipeline, $callable)
     {
-        return $block !== null ? $pipeline->execute($block) : $pipeline;
+        return isset($callable) ? $pipeline->execute($callable) : $pipeline;
     }
 
+    /**
+     * Creates a new transaction context and returns it, or returns the results of
+     * a transaction executed inside the optionally provided callable object.
+     *
+     * @param mixed $arg,... Options for the context, a callable object, or both.
+     * @return MultiExecContext|array
+     */
     public function multiExec(/* arguments */)
     {
         return $this->sharedInitializer(func_get_args(), 'initMultiExec');
     }
 
-    protected function initMultiExec(Array $options = null, $block = null)
+    /**
+     * Transaction context initializer.
+     *
+     * @param array $options Options for the context.
+     * @param mixed $callable Optional callable object used to execute the context.
+     * @return MultiExecContext|array
+     */
+    protected function initMultiExec(Array $options = null, $callable = null)
     {
         $transaction = new MultiExecContext($this, $options ?: array());
-        return isset($block) ? $transaction->execute($block) : $transaction;
+        return isset($callable) ? $transaction->execute($callable) : $transaction;
     }
 
+    /**
+     * Creates a new Publish / Subscribe context and returns it, or executes it
+     * inside the optionally provided callable object.
+     *
+     * @param mixed $arg,... Options for the context, a callable object, or both.
+     * @return MultiExecContext|array
+     */
     public function pubSub(/* arguments */)
     {
         return $this->sharedInitializer(func_get_args(), 'initPubSub');
     }
 
-    protected function initPubSub(Array $options = null, $block = null)
+    /**
+     * Publish / Subscribe context initializer.
+     *
+     * @param array $options Options for the context.
+     * @param mixed $callable Optional callable object used to execute the context.
+     * @return PubSubContext
+     */
+    protected function initPubSub(Array $options = null, $callable = null)
     {
         $pubsub = new PubSubContext($this, $options);
 
-        if (!isset($block)) {
+        if (!isset($callable)) {
             return $pubsub;
         }
 
         foreach ($pubsub as $message) {
-            if ($block($pubsub, $message) === false) {
+            if ($callable($pubsub, $message) === false) {
                 $pubsub->closeContext();
             }
         }
     }
 
+    /**
+     * Returns a new monitor context.
+     *
+     * @return MonitorContext
+     */
     public function monitor()
     {
         return new MonitorContext($this);

+ 5 - 0
lib/Predis/ClientException.php

@@ -11,6 +11,11 @@
 
 namespace Predis;
 
+/**
+ * Exception class that identifies client-side errors.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ClientException extends PredisException
 {
 }

+ 42 - 0
lib/Predis/ClientOptions.php

@@ -17,6 +17,11 @@ use Predis\Options\ClientProfile;
 use Predis\Options\ClientCluster;
 use Predis\Options\ClientConnectionFactory;
 
+/**
+ * Class that manages validation and conversion of client options.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ClientOptions
 {
     private static $_sharedOptions;
@@ -26,12 +31,20 @@ class ClientOptions
 
     private $_options = array();
 
+    /**
+     * @param array $options Array of client options.
+     */
     public function __construct(Array $options = array())
     {
         $this->_handlers = $this->initialize($options);
         $this->_defined = array_keys($options);
     }
 
+    /**
+     * Ensures that the default options are initialized.
+     *
+     * @return array
+     */
     private static function getSharedOptions()
     {
         if (isset(self::$_sharedOptions)) {
@@ -48,18 +61,35 @@ class ClientOptions
         return self::$_sharedOptions;
     }
 
+    /**
+     * Defines an option handler or overrides an existing one.
+     *
+     * @param string $option Name of the option.
+     * @param IOption $handler Handler for the option.
+     */
     public static function define($option, IOption $handler)
     {
         self::getSharedOptions();
         self::$_sharedOptions[$option] = $handler;
     }
 
+    /**
+     * Undefines the handler for the specified option.
+     *
+     * @param string $option Name of the option.
+     */
     public static function undefine($option)
     {
         self::getSharedOptions();
         unset(self::$_sharedOptions[$option]);
     }
 
+    /**
+     * Initializes client options handlers.
+     *
+     * @param array $options List of client options values.
+     * @return array
+     */
     private function initialize($options)
     {
         $handlers = self::getSharedOptions();
@@ -76,11 +106,23 @@ class ClientOptions
         return $handlers;
     }
 
+    /**
+     * Checks if the specified option is set.
+     *
+     * @param string $option Name of the option.
+     * @return Boolean
+     */
     public function __isset($option)
     {
         return in_array($option, $this->_defined);
     }
 
+    /**
+     * Returns the value of the specified option.
+     *
+     * @param string $option Name of the option.
+     * @return mixed
+     */
     public function __get($option)
     {
         if (isset($this->_options[$option])) {

+ 67 - 0
lib/Predis/Commands/Command.php

@@ -14,33 +14,60 @@ namespace Predis\Commands;
 use Predis\Helpers;
 use Predis\Distribution\INodeKeyGenerator;
 
+/**
+ * Base class for Redis commands.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 abstract class Command implements ICommand
 {
     private $_hash;
     private $_arguments = array();
 
+    /**
+     * Returns a filtered array of the arguments.
+     *
+     * @param array $arguments List of arguments.
+     * @return array
+     */
     protected function filterArguments(Array $arguments)
     {
         return $arguments;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function setArguments(Array $arguments)
     {
         $this->_arguments = $this->filterArguments($arguments);
         unset($this->_hash);
     }
 
+    /**
+     * Sets the arguments array without filtering.
+     *
+     * @param array $arguments List of arguments.
+     */
     public function setRawArguments(Array $arguments)
     {
         $this->_arguments = $arguments;
         unset($this->_hash);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function getArguments()
     {
         return $this->_arguments;
     }
 
+    /**
+     * Get the argument from the arguments list at the specified index.
+     *
+     * @param array $arguments Position of the argument.
+     */
     public function getArgument($index = 0)
     {
         if (isset($this->_arguments[$index]) === true) {
@@ -48,12 +75,23 @@ abstract class Command implements ICommand
         }
     }
 
+    /**
+     * Implements the rule that is used to prefix the keys and returns a new
+     * array of arguments with the modified keys.
+     *
+     * @param array $arguments Arguments of the command.
+     * @param string $prefix Prefix appended to each key in the arguments.
+     * @return array
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         $arguments[0] = "$prefix{$arguments[0]}";
         return $arguments;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function prefixKeys($prefix)
     {
         $arguments = $this->onPrefixKeys($this->_arguments, $prefix);
@@ -63,11 +101,22 @@ abstract class Command implements ICommand
         }
     }
 
+    /**
+     * Checks if the command can return an hash for client-side sharding.
+     *
+     * @return Boolean
+     */
     protected function canBeHashed()
     {
         return isset($this->_arguments[0]);
     }
 
+    /**
+     * Checks if the specified array of keys will generate the same hash.
+     *
+     * @param array $keys Array of keys.
+     * @return Boolean
+     */
     protected function checkSameHashForKeys(Array $keys)
     {
         if (($count = count($keys)) === 0) {
@@ -87,6 +136,9 @@ abstract class Command implements ICommand
         return true;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function getHash(INodeKeyGenerator $distributor)
     {
         if (isset($this->_hash)) {
@@ -103,11 +155,21 @@ abstract class Command implements ICommand
         return null;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return $data;
     }
 
+    /**
+     * Helper function used to reduce a list of arguments to a string.
+     *
+     * @param string $accumulator Temporary string.
+     * @param string $argument Current argument.
+     * @return string
+     */
     protected function toStringArgumentReducer($accumulator, $argument)
     {
         if (strlen($argument) > 32) {
@@ -118,6 +180,11 @@ abstract class Command implements ICommand
         return $accumulator;
     }
 
+    /**
+     * Returns a partial string representation of the command with its arguments.
+     *
+     * @return string
+     */
     public function __toString()
     {
         return array_reduce(

+ 13 - 0
lib/Predis/Commands/ConnectionAuth.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/auth
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ConnectionAuth extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'AUTH';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ConnectionEcho.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/echo
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ConnectionEcho extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'ECHO';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 16 - 0
lib/Predis/Commands/ConnectionPing.php

@@ -11,23 +11,39 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/ping
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ConnectionPing extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'PING';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return $data === 'PONG' ? true : false;

+ 13 - 0
lib/Predis/Commands/ConnectionQuit.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/quit
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ConnectionQuit extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'QUIT';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ConnectionSelect.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/select
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ConnectionSelect extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SELECT';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/HashDelete.php

@@ -13,18 +13,31 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/hdel
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashDelete extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HDEL';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterVariadicValues($arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 10 - 0
lib/Predis/Commands/HashExists.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hexists
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashExists extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HEXISTS';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 7 - 0
lib/Predis/Commands/HashGet.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hget
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashGet extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HGET';

+ 10 - 0
lib/Predis/Commands/HashGetAll.php

@@ -13,13 +13,23 @@ namespace Predis\Commands;
 
 use Predis\Iterators\MultiBulkResponseTuple;
 
+/**
+ * @link http://redis.io/commands/hgetall
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashGetAll extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HGETALL';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         if ($data instanceof \Iterator) {

+ 10 - 0
lib/Predis/Commands/HashGetMultiple.php

@@ -13,13 +13,23 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/hmget
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashGetMultiple extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HMGET';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterVariadicValues($arguments);

+ 7 - 0
lib/Predis/Commands/HashIncrementBy.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hincrby
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashIncrementBy extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HINCRBY';

+ 7 - 0
lib/Predis/Commands/HashKeys.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hkeys
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashKeys extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HKEYS';

+ 7 - 0
lib/Predis/Commands/HashLength.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hlen
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashLength extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HLEN';

+ 12 - 1
lib/Predis/Commands/HashSet.php

@@ -11,12 +11,23 @@
 
 namespace Predis\Commands;
 
-class HashSet extends Command {
+/**
+ * @link http://redis.io/commands/hset
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
+class HashSet extends Command
+{
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HSET';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 10 - 0
lib/Predis/Commands/HashSetMultiple.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hmset
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashSetMultiple extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HMSET';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         if (count($arguments) === 2 && is_array($arguments[1])) {

+ 10 - 0
lib/Predis/Commands/HashSetPreserve.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hsetnx
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashSetPreserve extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HSETNX';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 7 - 0
lib/Predis/Commands/HashValues.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/hvals
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class HashValues extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'HVALS';

+ 42 - 0
lib/Predis/Commands/ICommand.php

@@ -13,12 +13,54 @@ namespace Predis\Commands;
 
 use Predis\Distribution\INodeKeyGenerator;
 
+/**
+ * Defines an abstraction representing a Redis command.
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 interface ICommand
 {
+    /**
+     * Gets the ID of a Redis command.
+     *
+     * @return string
+     */
     public function getId();
+
+    /**
+     * Returns an hash of the command using the provided algorithm against the
+     * key (used to calculate the distribution of keys with client-side sharding).
+     *
+     * @param INodeKeyGenerator $distributor Distribution algorithm.
+     * @return int
+     */
     public function getHash(INodeKeyGenerator $distributor);
+
+    /**
+     * Set the arguments of the command.
+     *
+     * @param array $arguments List of arguments.
+     */
     public function setArguments(Array $arguments);
+
+    /**
+     * Get the arguments of the command.
+     *
+     * @return array
+     */
     public function getArguments();
+
+    /**
+     * Prefixes all the keys in the arguments of the command.
+     *
+     * @param string $prefix String user to prefix the keys.
+     */
     public function prefixKeys($prefix);
+
+    /**
+     * Parses a reply buffer and returns a PHP object.
+     *
+     * @param string $data Binary string containing the whole reply.
+     * @return mixed
+     */
     public function parseResponse($data);
 }

+ 16 - 0
lib/Predis/Commands/KeyDelete.php

@@ -13,23 +13,39 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/del
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyDelete extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'DEL';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterArrayArguments($arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         $args = $this->getArguments();

+ 10 - 0
lib/Predis/Commands/KeyExists.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/exists
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyExists extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'EXISTS';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 10 - 0
lib/Predis/Commands/KeyExpire.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/expire
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyExpire extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'EXPIRE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 10 - 0
lib/Predis/Commands/KeyExpireAt.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/expireat
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyExpireAt extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'EXPIREAT';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 10 - 0
lib/Predis/Commands/KeyKeys.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/keys
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyKeys extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'KEYS';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 7 - 0
lib/Predis/Commands/KeyKeysV12x.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/keys
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyKeysV12x extends KeyKeys
 {
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return explode(' ', $data);

+ 13 - 0
lib/Predis/Commands/KeyMove.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/move
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyMove extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'MOVE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 10 - 0
lib/Predis/Commands/KeyPersist.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/persist
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyPersist extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'PERSIST';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 13 - 0
lib/Predis/Commands/KeyRandom.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/randomkey
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyRandom extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RANDOMKEY';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return $data !== '' ? $data : null;

+ 13 - 0
lib/Predis/Commands/KeyRename.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/rename
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyRename extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RENAME';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 10 - 0
lib/Predis/Commands/KeyRenamePreserve.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/renamenx
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyRenamePreserve extends KeyRename
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RENAMENX';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 13 - 0
lib/Predis/Commands/KeySort.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sort
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeySort extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SORT';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         if (count($arguments) === 1) {
@@ -70,6 +80,9 @@ class KeySort extends Command
         return $query;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         $arguments[0] = "$prefix{$arguments[0]}";

+ 7 - 0
lib/Predis/Commands/KeyTimeToLive.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/ttl
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyTimeToLive extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'TTL';

+ 7 - 0
lib/Predis/Commands/KeyType.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/type
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyType extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'TYPE';

+ 7 - 0
lib/Predis/Commands/ListIndex.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lindex
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListIndex extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LINDEX';

+ 7 - 0
lib/Predis/Commands/ListInsert.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/linsert
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListInsert extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LINSERT';

+ 7 - 0
lib/Predis/Commands/ListLength.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/llen
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListLength extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LLEN';

+ 7 - 0
lib/Predis/Commands/ListPopFirst.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lpop
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPopFirst extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LPOP';

+ 13 - 0
lib/Predis/Commands/ListPopFirstBlocking.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/blpop
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPopFirstBlocking extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'BLPOP';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::skipLastArgument($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return $this->checkSameHashForKeys(

+ 7 - 0
lib/Predis/Commands/ListPopLast.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/rpop
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPopLast extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RPOP';

+ 7 - 0
lib/Predis/Commands/ListPopLastBlocking.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/brpop
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPopLastBlocking extends ListPopFirstBlocking
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'BRPOP';

+ 13 - 0
lib/Predis/Commands/ListPopLastPushHead.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/rpoplpush
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPopLastPushHead extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RPOPLPUSH';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return $this->checkSameHashForKeys($this->getArguments());

+ 13 - 0
lib/Predis/Commands/ListPopLastPushHeadBlocking.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/brpoplpush
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPopLastPushHeadBlocking extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'BRPOPLPUSH';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::skipLastArgument($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return $this->checkSameHashForKeys(

+ 7 - 0
lib/Predis/Commands/ListPushHead.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lpush
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPushHead extends ListPushTail
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LPUSH';

+ 7 - 0
lib/Predis/Commands/ListPushHeadX.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lpushx
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPushHeadX extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LPUSHX';

+ 10 - 0
lib/Predis/Commands/ListPushTail.php

@@ -13,13 +13,23 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/rpush
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPushTail extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RPUSH';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterVariadicValues($arguments);

+ 7 - 0
lib/Predis/Commands/ListPushTailX.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/rpushx
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListPushTailX extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'RPUSHX';

+ 7 - 0
lib/Predis/Commands/ListRange.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lrange
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListRange extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LRANGE';

+ 7 - 0
lib/Predis/Commands/ListRemove.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lrem
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListRemove extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LREM';

+ 7 - 0
lib/Predis/Commands/ListSet.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lset
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListSet extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LSET';

+ 7 - 0
lib/Predis/Commands/ListTrim.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/ltrim
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ListTrim extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LTRIM';

+ 19 - 0
lib/Predis/Commands/PrefixHelpers.php

@@ -11,8 +11,20 @@
 
 namespace Predis\Commands;
 
+/**
+ * Class that defines a few helpers method for prefixing keys.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class PrefixHelpers
 {
+    /**
+     * Applies the specified prefix to all the arguments.
+     *
+     * @param array $arguments Array of arguments.
+     * @param string $prefix The prefix string.
+     * @return array
+     */
     public static function multipleKeys(Array $arguments, $prefix)
     {
         foreach ($arguments as &$key) {
@@ -22,6 +34,13 @@ class PrefixHelpers
         return $arguments;
     }
 
+    /**
+     * Applies the specified prefix to all the arguments but the last one.
+     *
+     * @param array $arguments Array of arguments.
+     * @param string $prefix The prefix string.
+     * @return array
+     */
     public static function skipLastArgument(Array $arguments, $prefix)
     {
         $length = count($arguments);

+ 10 - 0
lib/Predis/Commands/Processors/ICommandProcessor.php

@@ -13,7 +13,17 @@ namespace Predis\Commands\Processors;
 
 use Predis\Commands\ICommand;
 
+/**
+ * A command processor processes commands before they are sent to Redis.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 interface ICommandProcessor
 {
+    /**
+     * Processes a Redis command.
+     *
+     * @param ICommand $command Redis command.
+     */
     public function process(ICommand $command);
 }

+ 24 - 2
lib/Predis/Commands/Processors/ICommandProcessorChain.php

@@ -11,10 +11,32 @@
 
 namespace Predis\Commands\Processors;
 
+/**
+ * A command processor chain processes a command using multiple chained command
+ * processor before it is sent to Redis.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 interface ICommandProcessorChain extends ICommandProcessor, \IteratorAggregate, \Countable
 {
+    /**
+     * Adds a command processor.
+     *
+     * @param ICommandProcessor $processor A command processor.
+     */
+    public function add(ICommandProcessor $processor);
+
+    /**
+     * Removes a command processor from the chain.
+     *
+     * @param ICommandProcessor $processor A command processor.
+     */
+    public function remove(ICommandProcessor $processor);
 
-    public function add(ICommandProcessor $preprocessor);
-    public function remove(ICommandProcessor $preprocessor);
+    /**
+     * Gets the ordered list of command processors in the chain.
+     *
+     * @return array
+     */
     public function getProcessors();
 }

+ 16 - 0
lib/Predis/Commands/Processors/IProcessingSupport.php

@@ -11,8 +11,24 @@
 
 namespace Predis\Commands\Processors;
 
+/**
+ * Defines an object that can process commands using command processors.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 interface IProcessingSupport
 {
+    /**
+     * Associates a command processor.
+     *
+     * @param ICommandProcessor $processor The command processor.
+     */
     public function setProcessor(ICommandProcessor $processor);
+
+    /**
+     * Returns the associated command processor.
+     *
+     * @return ICommandProcessor
+     */
     public function getProcessor();
 }

+ 22 - 0
lib/Predis/Commands/Processors/KeyPrefixProcessor.php

@@ -13,25 +13,47 @@ namespace Predis\Commands\Processors;
 
 use Predis\Commands\ICommand;
 
+/**
+ * Command processor that is used to prefix the keys contained in the arguments
+ * of a Redis command.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class KeyPrefixProcessor implements ICommandProcessor
 {
     private $_prefix;
 
+    /**
+     * @param string $prefix Prefix for the keys.
+     */
     public function __construct($prefix)
     {
         $this->setPrefix($prefix);
     }
 
+    /**
+     * Sets a prefix that is applied to all the keys.
+     *
+     * @param string $prefix Prefix for the keys.
+     */
     public function setPrefix($prefix)
     {
         $this->_prefix = $prefix;
     }
 
+    /**
+     * Get the current prefix.
+     *
+     * @return string
+     */
     public function getPrefix()
     {
         return $this->_prefix;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function process(ICommand $command)
     {
         $command->prefixKeys($this->_prefix);

+ 42 - 0
lib/Predis/Commands/Processors/ProcessorChain.php

@@ -13,10 +13,18 @@ namespace Predis\Commands\Processors;
 
 use Predis\Commands\ICommand;
 
+/**
+ * Default implementation of a command processors chain.
+ *
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ProcessorChain implements ICommandProcessorChain, \ArrayAccess
 {
     private $_processors;
 
+    /**
+     * @param array $processors List of instances of ICommandProcessor.
+     */
     public function __construct($processors = array())
     {
         foreach ($processors as $processor) {
@@ -24,11 +32,17 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess
         }
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function add(ICommandProcessor $processor)
     {
         $this->_processors[] = $processor;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function remove(ICommandProcessor $processor)
     {
         $index = array_search($processor, $this->_processors, true);
@@ -37,6 +51,9 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess
         }
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function process(ICommand $command)
     {
         $count = count($this->_processors);
@@ -45,31 +62,53 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess
         }
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function getProcessors() 
     {
         return $this->_processors;
     }
 
+    /**
+     * Returns an iterator over the list of command processor in the chain.
+     *
+     * @return \ArrayIterator
+     */
     public function getIterator()
     {
         return new \ArrayIterator($this->_processors);
     }
 
+    /**
+     * Returns the number of command processors in the chain.
+     *
+     * @return int
+     */
     public function count()
     {
         return count($this->_processors);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function offsetExists($index)
     {
         return isset($this->_processors[$index]);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function offsetGet($index)
     {
         return $this->_processors[$index];
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function offsetSet($index, $processor)
     {
         if (!$processor instanceof ICommandProcessor) {
@@ -82,6 +121,9 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess
         $this->_processors[$index] = $processor;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function offsetUnset($index)
     {
         unset($this->_processors[$index]);

+ 10 - 0
lib/Predis/Commands/PubSubPublish.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/publish
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class PubSubPublish extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'PUBLISH';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 16 - 0
lib/Predis/Commands/PubSubSubscribe.php

@@ -13,23 +13,39 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/subscribe
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class PubSubSubscribe extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SUBSCRIBE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterArrayArguments($arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 7 - 0
lib/Predis/Commands/PubSubSubscribeByPattern.php

@@ -13,8 +13,15 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/psubscribe
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class PubSubSubscribeByPattern extends PubSubSubscribe
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'PSUBSCRIBE';

+ 13 - 0
lib/Predis/Commands/PubSubUnsubscribe.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/unsubscribe
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class PubSubUnsubscribe extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'UNSUBSCRIBE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 7 - 0
lib/Predis/Commands/PubSubUnsubscribeByPattern.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/punsubscribe
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class PubSubUnsubscribeByPattern extends PubSubUnsubscribe
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'PUNSUBSCRIBE';

+ 23 - 0
lib/Predis/Commands/ScriptedCommand.php

@@ -11,10 +11,27 @@
 
 namespace Predis\Commands;
 
+/**
+ * Base class used to implement an higher level abstraction for "virtual"
+ * commands based on EVAL.
+ *
+ * @link http://redis.io/commands/eval
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 abstract class ScriptedCommand extends ServerEval
 {
+    /**
+     * Gets the body of a Lua script.
+     *
+     * @return string
+     */
     public abstract function getScript();
 
+    /*
+     * Gets the number of arguments that should be considered as keys.
+     *
+     * @return int
+     */
     protected function keysCount()
     {
         // The default behaviour for the base class is to use all the arguments
@@ -22,11 +39,17 @@ abstract class ScriptedCommand extends ServerEval
         return count($this->getArguments());
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return array_merge(array($this->getScript(), $this->keysCount()), $arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function getKeys()
     {
         return array_slice($this->getArguments(), 2, $this->keysCount());

+ 16 - 0
lib/Predis/Commands/ServerBackgroundRewriteAOF.php

@@ -11,23 +11,39 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/bgrewriteaof
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerBackgroundRewriteAOF extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'BGREWRITEAOF';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return $data == 'Background append only file rewriting started';

+ 16 - 0
lib/Predis/Commands/ServerBackgroundSave.php

@@ -11,23 +11,39 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/bgsave
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerBackgroundSave extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'BGSAVE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         if ($data == 'Background saving started') {

+ 23 - 0
lib/Predis/Commands/ServerClient.php

@@ -11,23 +11,39 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/client
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerClient extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'CLIENT';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         $args = array_change_key_case($this->getArguments(), CASE_UPPER);
@@ -41,6 +57,13 @@ class ServerClient extends Command
         }
     }
 
+    /**
+     * Parses the reply buffer and returns the list of clients returned by
+     * the CLIENT LIST command.
+     *
+     * @param string $data Reply buffer
+     * @return array
+     */
     protected function parseClientList($data)
     {
         $clients = array();

+ 13 - 0
lib/Predis/Commands/ServerConfig.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/config
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerConfig extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'CONFIG';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerDatabaseSize.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/dbsize
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerDatabaseSize extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'DBSIZE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerEval.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/eval
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerEval extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'EVAL';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         $arguments = $this->getArguments();
@@ -29,6 +39,9 @@ class ServerEval extends Command
         return $arguments;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 7 - 0
lib/Predis/Commands/ServerEvalSHA.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/evalsha
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerEvalSHA extends ServerEval
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'EVALSHA';

+ 13 - 0
lib/Predis/Commands/ServerFlushAll.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/flushall
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerFlushAll extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'FLUSHALL';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerFlushDatabase.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/flushdb
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerFlushDatabase extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'FLUSHDB';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 28 - 0
lib/Predis/Commands/ServerInfo.php

@@ -11,23 +11,39 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/info
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerInfo extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'INFO';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         $info      = array();
@@ -55,6 +71,12 @@ class ServerInfo extends Command
         return $info;
     }
 
+    /**
+     * Parses the reply buffer and extracts the statistics of each logical DB.
+     *
+     * @param string $str Reply buffer.
+     * @return array
+     */
     protected function parseDatabaseStats($str)
     {
         $db = array();
@@ -67,6 +89,12 @@ class ServerInfo extends Command
         return $db;
     }
 
+    /**
+     * Parses the reply buffer and extracts the allocation statistics.
+     *
+     * @param string $str Reply buffer.
+     * @return array
+     */
     protected function parseAllocationStats($str)
     {
         $stats = array();

+ 7 - 0
lib/Predis/Commands/ServerInfoV26x.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/info
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerInfoV26x extends ServerInfo
 {
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         $info = array();

+ 13 - 0
lib/Predis/Commands/ServerLastSave.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/lastsave
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerLastSave extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'LASTSAVE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerMonitor.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/monitor
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerMonitor extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'MONITOR';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerObject.php

@@ -13,18 +13,31 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/object
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerObject extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'OBJECT';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerSave.php

@@ -11,18 +11,31 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/save
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerSave extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SAVE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/ServerShutdown.php

@@ -11,17 +11,30 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/shutdown
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerShutdown extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId() {
         return 'SHUTDOWN';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 16 - 0
lib/Predis/Commands/ServerSlaveOf.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/slaveof
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class ServerSlaveOf extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SLAVEOF';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         if (count($arguments) === 0 || $arguments[0] === 'NO ONE') {
@@ -27,11 +37,17 @@ class ServerSlaveOf extends Command
         return $arguments;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         /* NOOP */
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;

+ 13 - 0
lib/Predis/Commands/SetAdd.php

@@ -13,18 +13,31 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/sadd
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetAdd extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SADD';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterVariadicValues($arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 7 - 0
lib/Predis/Commands/SetCardinality.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/scard
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetCardinality extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SCARD';

+ 10 - 0
lib/Predis/Commands/SetDifference.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sdiff
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetDifference extends SetIntersection
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SDIFF';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);

+ 7 - 0
lib/Predis/Commands/SetDifferenceStore.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sdiffstore
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetDifferenceStore extends SetIntersectionStore
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SDIFFSTORE';

+ 16 - 0
lib/Predis/Commands/SetIntersection.php

@@ -13,23 +13,39 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/sinter
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetIntersection extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SINTER';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterArrayArguments($arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return $this->checkSameHashForKeys($this->getArguments());

+ 16 - 0
lib/Predis/Commands/SetIntersectionStore.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sinterstore
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetIntersectionStore extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SINTERSTORE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         if (count($arguments) === 2 && is_array($arguments[1])) {
@@ -27,11 +37,17 @@ class SetIntersectionStore extends Command
         return $arguments;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::multipleKeys($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return $this->checkSameHashForKeys($this->getArguments());

+ 10 - 0
lib/Predis/Commands/SetIsMember.php

@@ -11,13 +11,23 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sismember
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetIsMember extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SISMEMBER';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 7 - 0
lib/Predis/Commands/SetMembers.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/smembers
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetMembers extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SMEMBERS';

+ 16 - 0
lib/Predis/Commands/SetMove.php

@@ -11,23 +11,39 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/smove
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetMove extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SMOVE';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function onPrefixKeys(Array $arguments, $prefix)
     {
         return PrefixHelpers::skipLastArgument($arguments, $prefix);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function canBeHashed()
     {
         return false;
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 7 - 0
lib/Predis/Commands/SetPop.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/spop
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetPop  extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SPOP';

+ 7 - 0
lib/Predis/Commands/SetRandomMember.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/srandmember
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetRandomMember extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SRANDMEMBER';

+ 13 - 0
lib/Predis/Commands/SetRemove.php

@@ -13,18 +13,31 @@ namespace Predis\Commands;
 
 use Predis\Helpers;
 
+/**
+ * @link http://redis.io/commands/srem
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetRemove extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SREM';
     }
 
+    /**
+     * {@inheritdoc}
+     */
     protected function filterArguments(Array $arguments)
     {
         return Helpers::filterVariadicValues($arguments);
     }
 
+    /**
+     * {@inheritdoc}
+     */
     public function parseResponse($data)
     {
         return (bool) $data;

+ 7 - 0
lib/Predis/Commands/SetUnion.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sunion
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetUnion extends SetIntersection
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SUNION';

+ 7 - 0
lib/Predis/Commands/SetUnionStore.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/sunionstore
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class SetUnionStore extends SetIntersectionStore
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'SUNIONSTORE';

+ 7 - 0
lib/Predis/Commands/StringAppend.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/append
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class StringAppend extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'APPEND';

+ 7 - 0
lib/Predis/Commands/StringDecrement.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/decr
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class StringDecrement extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'DECR';

+ 7 - 0
lib/Predis/Commands/StringDecrementBy.php

@@ -11,8 +11,15 @@
 
 namespace Predis\Commands;
 
+/**
+ * @link http://redis.io/commands/decrby
+ * @author Daniele Alessandri <suppakilla@gmail.com>
+ */
 class StringDecrementBy extends Command
 {
+    /**
+     * {@inheritdoc}
+     */
     public function getId()
     {
         return 'DECRBY';

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