Browse Source

Reuse code.

Daniele Alessandri 13 years ago
parent
commit
3733e790eb
1 changed files with 3 additions and 9 deletions
  1. 3 9
      lib/Predis/Commands/HashGetMultiple.php

+ 3 - 9
lib/Predis/Commands/HashGetMultiple.php

@@ -2,20 +2,14 @@
 
 namespace Predis\Commands;
 
+use Predis\Helpers;
+
 class HashGetMultiple extends Command {
     public function getId() {
         return 'HMGET';
     }
 
     protected function filterArguments(Array $arguments) {
-        if (count($arguments) === 2 && is_array($arguments[1])) {
-            $flattenedKVs = array($arguments[0]);
-            $args = $arguments[1];
-            foreach ($args as $v) {
-                $flattenedKVs[] = $v;
-            }
-            return $flattenedKVs;
-        }
-        return $arguments;
+        return Helpers::filterVariadicValues($arguments);
     }
 }