-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.2.11 |
Good morning,
I am using the tagging of CacheItems in my project and have a small issue with the class definition of the CacheItem
.
Since the tag
method is not defined in the PSR\CacheItemInterface
and the CacheItem
is final it's impossible to mock CacheItems
in tests in a proper way.
My suggestion would be to add an interface that extends the CacheItemInterface and will be implemented by the CacheItem
.
interface TagAwareCacheItemInterface extends CacheItemInterface
{
// ...
public function tag(array $tags);
}
class CacheItem extends TagAwareCacheItemInterface
{
}
I think this should not break BC, correct me if I am wrong.
Cheers,
Christian