Skip to content

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