mirror of
https://github.com/predis/predis.git
synced 2026-09-10 02:16:51 +00:00
Reuse code.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user