Skip to content
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

[5.4] Fix PhpRedis’ ZADD #17832

Merged
merged 3 commits into from
Feb 9, 2017
Merged

[5.4] Fix PhpRedis’ ZADD #17832

merged 3 commits into from
Feb 9, 2017

Conversation

tillkruss
Copy link
Contributor

@tillkruss tillkruss commented Feb 8, 2017

Fixes #17828.

This PR add compatibility for all 3 Predis signature styles to PhpRedis connections.

Redis::zadd('key', 10, 'member');
Redis::zadd('key', 10, 'member1', 20, 'member2');
Redis::zadd('key', ['member1' => 10, 'member2' => 20]);

The method signature changed, but the functionality is the same.

@tillkruss tillkruss changed the title Fix PhpRedis’ ZADD [5.4] Fix PhpRedis’ ZADD Feb 8, 2017
if (count($dictionary) === 1) {
$dictionary = call_user_func_array('array_merge', call_user_func_array('array_map',
[null, array_values($dictionary[0]), array_keys($dictionary[0])]
));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯wathanized 💥

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I have no idea what is happening there. lol

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to use a simpler approach that is easier to read on first glance?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, a simple for loop and a temporary variable. I'll push another commit in a few.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: 5de9a67

@taylorotwell taylorotwell merged commit 57eacff into laravel:5.4 Feb 9, 2017
@tillkruss tillkruss deleted the zadd-fix branch April 16, 2017 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants