-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
RedisStore use ClientInterface instead of Client #95
Conversation
Changed RedisStore te accept ClientInterface instead of Client so we are not locked to the the default implementation Added tests for when we pass ClientInterface instead of a Client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fhjbalfoort Thank you for your PR. This looks great to me!
Although the code style check in CI has passed, I've left a tiny suggestion.
@@ -178,7 +178,7 @@ public function get(string $key) | |||
{ | |||
try { | |||
$result = $this->redis->get($key); | |||
if ($this->redis instanceof \Predis\Client && $result === null) { | |||
if ($this->redis instanceof \Predis\ClientInterface && $result === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ($this->redis instanceof \Predis\ClientInterface && $result === null) { | |
if ($this->redis instanceof \Predis\ClientInterface && $result === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing and updated the MR with your suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you!
This pull request has been released as v2.0.2. 🎉 |
We use RedisStore in combination with Predis. We wrap the default client with metric but RedisStore doesn't accept a ClientInterface so we are stuck with passing a Client.
I changed the RedisStore so that it will accept a ClientInterface instead of a Client