8000 feature #27398 [Cache] Remove TaggableCacheInterface, alias cache.app… · symfony/symfony@c81f88f · GitHub
[go: up one dir, main page]

Skip to content

Commit c81f88f

Browse files
committed
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
2 parents 5abffbb + c250fbd commit c81f88f

File tree

6 files changed

+7
-47
lines changed

6 files changed

+7
-47
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@
126126
<service id="cache.global_clearer" parent="cache.default_clearer" public="true" />
127127
<service id="cache.app_clearer" alias="cache.default_clearer" public="true" />
128128
<service id="Psr\Cache\CacheItemPoolInterface" alias="cache.app" />
129-
<service id="Symfony\Component\Cache\TaggableCacheInterface" alias="cache.app.taggable" />
130129
<service id="Psr\SimpleCache\CacheInterface" alias="cache.app.simple" />
131130
<service id="Symfony\Component\Cache\Adapter\AdapterInterface" alias="cache.app" />
132-
<service id="Symfony\Component\Cache\CacheInterface" alias="cache.app" />
131+
<service id="Symfony\Component\Cache\CacheInterface" alias="cache.app.taggable" />
133132
</services>
134133
</container>

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313

1414
use Psr\Cache\CacheItemInterface;
1515
use Psr\Cache\InvalidArgumentException;
16+
use Symfony\Component\Cache\CacheInterface;
1617
use Symfony\Component\Cache\CacheItem;
1718
use Symfony\Component\Cache\PruneableInterface;
1819
use Symfony\Component\Cache\ResettableInterface;
19-
use Symfony\Component\Cache\TaggableCacheInterface;
2020
use Symfony\Component\Cache\Traits\GetTrait;
2121
use Symfony\Component\Cache\Traits\ProxyTrait;
2222

2323
/**
2424
* @author Nicolas Grekas <p@tchwork.com>
2525
*/
26-
class TagAwareAdapter implements TagAwareAdapterInterface, TaggableCacheInterface, PruneableInterface, ResettableInterface
26+
class TagAwareAdapter implements CacheInterface, TagAwareAdapterInterface, PruneableInterface, ResettableInterface
2727
{
2828
const TAGS_PREFIX = "\0tags\0";
2929

src/Symfony/Component/Cache/Adapter/TraceableTagAwareAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
namespace Symfony\Component\Cache\Adapter;
1313

14-
use Symfony\Component\Cache\TaggableCacheInterface;
14+
use Symfony\Component\Cache\CacheInterface;
1515

1616
/**
1717
* @au 8000 thor Robin Chalas <robin.chalas@gmail.com>
1818
*/
19-
class TraceableTagAwareAdapter extends TraceableAdapter implements TaggableCacheInterface, TagAwareAdapterInterface
19+
class TraceableTagAwareAdapter extends TraceableAdapter implements CacheInterface, TagAwareAdapterInterface
2020
{
2121
public function __construct(TagAwareAdapterInterface $pool)
2222
{

src/Symfony/Component/Cache/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
4.2.0
55
-----
66

7-
* added `CacheInterface` and `TaggableCacheInterface`
7+
* added `CacheInterface`, which should become the preferred way to use a cache
88
* throw `LogicException` when `CacheItem::tag()` is called on an item coming from a non tag-aware pool
99

1010
3.4.0

src/Symfony/Component/Cache/CacheInterface.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\Cache;
1313

14-
use Psr\Cache\CacheItemInterface;
15-
1614
/**
1715
* Gets and stores items from a cache.
1816
*
@@ -22,14 +20,12 @@
2220
* - the corresponding PSR-6 CacheItemInterface object,
2321
* allowing time-based expiration control.
2422
*
25-
* If you need tag-based invalidation, use TaggableCacheInterface instead.
26-
*
2723
* @author Nicolas Grekas <p@tchwork.com>
2824
*/
2925
interface CacheInterface
3026
{
3127
/**
32-
* @param callable(CacheItemInterface):mixed $callback Should return the computed value for the given key/item
28+
* @param callable(CacheItem):mixed $callback Should return the computed value for the given key/item
3329
*
3430
* @return mixed The value corresponding to the provided key
3531
*/

src/Symfony/Component/Cache/TaggableCacheInterface.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0