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

RedisStore use ClientInterface instead of Client #95

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

fhjbalfoort
Copy link

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

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
@coveralls
Copy link

coveralls commented Apr 26, 2022

Coverage Status

Coverage increased (+0.3%) to 92.456% when pulling 3a8c69e on fhjbalfoort:master into 7c7dcac on ackintosh:master.

Copy link
Owner

@ackintosh ackintosh left a 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) {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
if ($this->redis instanceof \Predis\ClientInterface && $result === null) {
if ($this->redis instanceof \Predis\ClientInterface && $result === null) {

Copy link
Author

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

Copy link
Owner

@ackintosh ackintosh left a 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!

@ackintosh ackintosh merged commit 5792a96 into ackintosh:master Apr 26, 2022
@ackintosh
Copy link
Owner

This pull request has been released as v2.0.2. 🎉
https://github.com/ackintosh/ganesha/releases/tag/2.0.2

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.

None yet

4 participants