Skip to content

fix prefix duplication on clear() #22

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

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

pavarnos
Copy link
Contributor

@pavarnos pavarnos commented Sep 1, 2020

$cache = new Cache($redis, 'focus:');
$cache->set('foo', 'bar');
$cache->clear()

would call

$redis->del('focus:focus:foo')

because clear() finds all the keys matching the prefix and passes those to deleteMultiple(), but then deleteMultiple() adds the prefix again before deleting.

@WyriHaximus WyriHaximus added this to the 4.0.1 milestone Sep 1, 2020
@WyriHaximus WyriHaximus merged commit 0c62bcc into WyriHaximus:master Sep 1, 2020
@WyriHaximus
Copy link
Owner

Thanks, I'll tag a new release later today 👍

@pavarnos
Copy link
Contributor Author

pavarnos commented Sep 1, 2020

thank you!
I tried to run the phpunit tests, but I see Function ReflectionType::__toString() is deprecated fail messages for every test because wyrihaximus/test-utilities uses phpunit 8.0, which is not compatible with php7.4 sebastianbergmann/phpunit#3728

@WyriHaximus
Copy link
Owner

@pavarnos no worries, will bump this package to PHP 7.4+ at the end of the year anyway, including a huge update of the QA tool set. Just releases your fix, thanks again 👍

@pavarnos
Copy link
Contributor Author

pavarnos commented Sep 7, 2020

awesome. thanks for the release. it would be cool to see the ReactPHP suite of packages use PHP8 features and stricter typing: I use phpstan --level=max on all my stuff and more/stricter type info helps catch a lot of bugs before customers do

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