Jelajahi Sumber

Add getArgument($index) in Predis\Command\CommandInterface.

This method should have been part of the interface since start since
it is used through the library. We also do not specify a default value
for the index argument since it does not make much sense.
Daniele Alessandri 12 tahun lalu
induk
melakukan
6b6b73f5f4

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

@@ -65,7 +65,7 @@ abstract class AbstractCommand implements CommandInterface
      *
      * @param array $arguments Position of the argument.
      */
-    public function getArgument($index = 0)
+    public function getArgument($index)
     {
         if (isset($this->arguments[$index])) {
             return $this->arguments[$index];

+ 7 - 0
lib/Predis/Command/CommandInterface.php

@@ -59,6 +59,13 @@ interface CommandInterface
      */
     public function getArguments();
 
+    /**
+     * Gets the argument of the command at the specified index.
+     *
+     * @return array
+     */
+    public function getArgument($index);
+
     /**
      * Parses a reply buffer and returns a PHP object.
      *