diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml index d0e596ab83..cd4d51e2c3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml @@ -126,9 +126,8 @@ - - + diff --git a/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php index 257e404e1c..e810f5d00f 100644 --- a/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php @@ -13,17 +13,17 @@ namespace Symfony\Component\Cache\Adapter; 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 */ -class TagAwareAdapter implements TagAwareAdapterInterface, TaggableCacheInterface, PruneableInterface, ResettableInterface +class TagAwareAdapter implements CacheInterface, TagAwareAdapterInterface, PruneableInterface, ResettableInterface { const TAGS_PREFIX = "\0tags\0"; diff --git a/src/Symfony/Component/Cache/Adapter/TraceableTagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/TraceableTagAwareAdapter.php index 2fda8b3602..c597c81c38 100644 --- a/src/Symfony/Component/Cache/Adapter/TraceableTagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/TraceableTagAwareAdapter.php @@ -11,12 +11,12 @@ namespace Symfony\Component\Cache\Adapter; -use Symfony\Component\Cache\TaggableCacheInterface; +use Symfony\Component\Cache\CacheInterface; /** * @author Robin Chalas */ -class TraceableTagAwareAdapter extends TraceableAdapter implements TaggableCacheInterface, TagAwareAdapterInterface +class TraceableTagAwareAdapter extends TraceableAdapter implements CacheInterface, TagAwareAdapterInterface { public function __construct(TagAwareAdapterInterface $pool) { diff --git a/src/Symfony/Component/Cache/CHANGELOG.md b/src/Symfony/Component/Cache/CHANGELOG.md index d21b2cbda4..f6fb43ebe7 100644 --- a/src/Symfony/Component/Cache/CHANGELOG.md +++ b/src/Symfony/Component/Cache/CHANGELOG.md @@ -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 diff --git a/src/Symfony/Component/Cache/CacheInterface.php b/src/Symfony/Component/Cache/CacheInterface.php index c5c877ddbd..49194d135e 100644 --- a/src/Symfony/Component/Cache/CacheInterface.php +++ b/src/Symfony/Component/Cache/CacheInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Cache; -use Psr\Cache\CacheItemInterface; - /** * Gets and stores items from a cache. * @@ -22,14 +20,12 @@ use Psr\Cache\CacheItemInterface; * - the corresponding PSR-6 CacheItemInterface object, * allowing time-based expiration control. * - * If you need tag-based invalidation, use TaggableCacheInterface instead. - * * @author Nicolas Grekas */ 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 */ diff --git a/src/Symfony/Component/Cache/TaggableCacheInterface.php b/src/Symfony/Component/Cache/TaggableCacheInterface.php deleted file mode 100644 index c112e72586..0000000000 --- a/src/Symfony/Component/Cache/TaggableCacheInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Cache; - -/** - * Gets and stores items from a tag-aware cache. - * - * On cache misses, a callback is called that should return the missing value. - * It is given two arguments: - * - the missing cache key - * - the corresponding Symfony CacheItem object, - * allowing time-based *and* tags-based expiration control - * - * If you don't need tags-based invalidation, use CacheInterface instead. - * - * @author Nicolas Grekas - */ -interface TaggableCacheInterface extends CacheInterface -{ - /** - * @param callable(CacheItem):mixed $callback Should return the computed value for the given key/item - * - * @return mixed The value corresponding to the provided key - */ - public function get(string $key, callable $callback); -}