Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Description
Description
Hello. The issue that I use RedisTagAwareAdapter for production, but need to test it in memory with ArrayAdapter or NullAdapter, which doesn't implements TagAwareAdapterInterface.
So for tests inproduction code I should check if adapter implements TagAwareAdapterInterface and, for example, add tags to cache item:
// production code below// adapter can be RedisTagAwareAdapter or ArrayAdapter or NullAdapter if ($this->adapter instanceof TagAwareAdapterInterface) { $item->tag([self::TAG]); }
Without checking I will get an error'Cache item "%s" comes from a non tag-aware pool: you cannot tag it.'
.
Finally code is not totally covered
I think will be great to create new class ArrayTagAwareAdapter and add interface TagAwareAdapterInterface to NullAdapter out-of-box to easier test Cache layer.
What do you think?
p.s. before doing a PR I started this short discussion
Example
No response