-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zRange and zRevRange has inconsistent parameters #1555
Comments
Hi @RobbieLePommie, I tend to agree that the inconsistency is weird, but it's just a historical anachronism at this point that predates even my involvement in the project. There are a variety of things like this that I'd like to remove such as Allowing users to pass either the boolean or |
@michael-grunder IMO we need to remove all anachronism from code and make API similar for all methods but from the other side if we will handle array and boolean users will swearn less 😄 |
To add to the list:
Reason for suggesting fix: IT caused automated tests to fail while adapting to the library compared to other systems. |
I've wanted to change this one for years, and we can since we're allowed to break things for 5.0. 😄 |
* Update ZRANGE so you can pass ['withscores' => true] like you can with ZRANGEBYSCORE. * Update the PING command to accept an optional argument. Addresses #1555
It's still a work in progress, but the initial commit for these changes is above in f6e92fc. Right now I'm returning @yatsukhnenko What do you think about the reply type? |
@michael-grunder don't you want to move changes related to PING to separated branch? |
I can, sure. Edit: The PING flame war can be found -> #1563 😂 |
@michael-grunder - Thanks for addressing - it will help with migration and compatibility moving forward. |
Expected behaviour
zRange and zRevRange should accept an array of options
['WITHSCORES' => true]
as the fourth parameter, and not the boolean.Reasons:
zRemRangeByRank
) where it refers to$redis->zRange('key', 0, -1, ['withscores' => TRUE]); /* ['three' => 3] */
Actual behaviour
It accepts a boolean (true/false), not array.
I'm seeing this behaviour on
Master and Developer branch. PHP 7.1 - PHP 7.3
I've checked
develop
branchOther Notes
As a breaking change, I would suggest accepting both as a deprecation path. Currently prevents easy adoption of the library.
The text was updated successfully, but these errors were encountered: