mirror of
https://github.com/predis/predis.git
synced 2026-08-31 04:35:05 +00:00
Enhancement: when using multibulk response iterators, ZRANGE and ZSETRANGE now return a MultiBulkResponseKVIterator when called with the WITHSCORES parameter.
This commit is contained in:
@@ -1555,6 +1555,9 @@ class ZSetRange extends \Predis\InlineCommand {
|
||||
$arguments = $this->getArguments();
|
||||
if (count($arguments) === 4) {
|
||||
if (strtolower($arguments[3]) === 'withscores') {
|
||||
if ($data instanceof \Iterator) {
|
||||
return new \Predis\Utilities\MultiBulkResponseKVIterator($data);
|
||||
}
|
||||
$result = array();
|
||||
for ($i = 0; $i < count($data); $i++) {
|
||||
$result[] = array($data[$i], $data[++$i]);
|
||||
|
||||
Reference in New Issue
Block a user