Permalink
Browse files

feature #27398 [Cache] Remove TaggableCacheInterface, alias cache.app…

….taggable to CacheInterface (nicolas-grekas)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Actually, there is no downside in using a taggable cache pool as a backend for CacheInterface.
This means we can simplify things and remove the TaggableCacheInterface and keep only CacheInterface (master-only).

Commits
-------

c250fbd [Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface
  • Loading branch information...
fabpot committed May 31, 2018
2 parents 5abffbb + c250fbd commit c81f88f38bc883fc8b8950f8840bef22db29eda0
@@ -126,9 +126,8 @@
<service id="cache.global_clearer" parent="cache.default_clearer" public="true" />
<service id="cache.app_clearer" alias="cache.default_clearer" public="true" />
<service id="Psr\Cache\CacheItemPoolInterface" alias="cache.app" />
<service id="Symfony\Component\Cache\TaggableCacheInterface" alias="cache.app.taggable" />
<service id="Psr\SimpleCache\CacheInterface" alias="cache.app.simple" />
<service id="Symfony\Component\Cache\Adapter\AdapterInterface" alias="cache.app" />
<service id="Symfony\Component\Cache\CacheInterface" alias="cache.app" />
<service id="Symfony\Component\Cache\CacheInterface" alias="cache.app.taggable" />
</services>
</container>
@@ -13,17 +13,17 @@
use Psr\Cache\CacheItemInterface;
use Psr\Cache\InvalidArgumentException;
use Symfony\Component\Cache\CacheInterface;
use Symfony\Component\Cache\CacheItem;
use Symfony\Component\Cache\PruneableInterface;
use Symfony\Component\Cache\ResettableInterface;
use Symfony\Component\Cache\TaggableCacheInterface;
use Symfony\Component\Cache\Traits\GetTrait;
use Symfony\Component\Cache\Traits\ProxyTrait;
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
class TagAwareAdapter implements TagAwareAdapterInterface, TaggableCacheInterface, PruneableInterface, ResettableInterface
class TagAwareAdapter implements CacheInterface, TagAwareAdapterInterface, PruneableInterface, ResettableInterface
{
const TAGS_PREFIX = "\0tags\0";
@@ -11,12 +11,12 @@
namespace Symfony\Component\Cache\Adapter;
use Symfony\Component\Cache\TaggableCacheInterface;
use Symfony\Component\Cache\CacheInterface;
/**
* @author Robin Chalas <robin.chalas@gmail.com>
*/
class TraceableTagAwareAdapter extends TraceableAdapter implements TaggableCacheInterface, TagAwareAdapterInterface
class TraceableTagAwareAdapter extends TraceableAdapter implements CacheInterface, TagAwareAdapterInterface
{
public function __construct(TagAwareAdapterInterface $pool)
{
@@ -4,7 +4,7 @@ CHANGELOG
4.2.0
-----
* added `CacheInterface` and `TaggableCacheInterface`
* added `CacheInterface`, which should become the preferred way to use a cache
* throw `LogicException` when `CacheItem::tag()` is called on an item coming from a non tag-aware pool
3.4.0
@@ -11,8 +11,6 @@
namespace Symfony\Component\Cache;
use Psr\Cache\CacheItemInterface;
/**
* Gets and stores items from a cache.
*
@@ -22,14 +20,12 @@
* - the corresponding PSR-6 CacheItemInterface object,
* allowing time-based expiration control.
*
* If you need tag-based invalidation, use TaggableCacheInterface instead.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
interface CacheInterface
{
/**
* @param callable(CacheItemInterface):mixed $callback Should return the computed value for the given key/item
* @param callable(CacheItem):mixed $callback Should return the computed value for the given key/item
*
* @return mixed The value corresponding to the provided key
*/

This file was deleted.

Oops, something went wrong.

0 comments on commit c81f88f

Please sign in to comment.