diff --git a/lib/Predis/Commands/SetIntersectionStore.php b/lib/Predis/Commands/SetIntersectionStore.php index dc0087a6..fb52741f 100644 --- a/lib/Predis/Commands/SetIntersectionStore.php +++ b/lib/Predis/Commands/SetIntersectionStore.php @@ -7,6 +7,9 @@ use Predis\Utils; class SetIntersectionStore extends Command { public function getId() { return 'SINTERSTORE'; } public function filterArguments(Array $arguments) { - return Utils::filterArrayArguments($arguments); + if (count($arguments) === 2 && is_array($arguments[1])) { + return array_merge(array($arguments[0]), $arguments[1]); + } + return $arguments; } } diff --git a/test/RedisCommandsTest.php b/test/RedisCommandsTest.php index c6aed5da..d96a1c15 100644 --- a/test/RedisCommandsTest.php +++ b/test/RedisCommandsTest.php @@ -1013,6 +1013,9 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase { $this->redis->set('foo', 'bar'); $this->assertEquals(count($setA), $this->redis->sinterstore('foo', 'setA')); + // accepts an array for the list of source keys + $this->assertEquals(4, $this->redis->sinterstore('setC', array('setA', 'setB'))); + // wrong type $this->redis->set('foo', 'bar'); RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) { @@ -1076,6 +1079,9 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase { $this->redis->set('foo', 'bar'); $this->assertEquals(count($setA), $this->redis->sunionstore('foo', 'setA')); + // accepts an array for the list of source keys + $this->assertEquals(9, $this->redis->sunionstore('setC', array('setA', 'setB'))); + // wrong type $this->redis->set('foo', 'bar'); RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) {