Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5cc9ed2

Browse files
committed
feature #19515 [Cache] Drop TaggedCacheItemInterface (nicolas-grekas)
This PR was merged into the 3.2-dev branch. Discussion ---------- [Cache] Drop TaggedCacheItemInterface | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Introducing this interface was a mistake, we should drop it: the CacheItem class is final, and it can be instantiated only through a cache adapter. Which means there is no way to reuse this interface in any meaningful way as far as extensibility/interoperability is concerned. Commits ------- 624890b [Cache] Drop TaggedCacheItemInterface
2 parents f208ac8 + 624890b commit 5cc9ed2

File tree

2 files changed

+9
-36
lines changed

2 files changed

+9
-36
lines changed

src/Symfony/Component/Cache/CacheItem.php

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

1212
namespace Symfony\Component\Cache;
1313

14+
use Psr\Cache\CacheItemInterface;
1415
use Psr\Log\LoggerInterface;
1516
use Symfony\Component\Cache\Exception\InvalidArgumentException;
1617

1718
/**
1819
* @author Nicolas Grekas <[email protected]>
1920
*/
20-
final class CacheItem implements TaggedCacheItemInterface
21+
final class CacheItem implements CacheItemInterface
2122
{
2223
protected $key;
2324
protected $value;
@@ -97,7 +98,13 @@ public function expiresAfter($time)
9798
}
9899

99100
/**
100-
* {@inheritdoc}
101+
* Adds a tag to a cache item.
102+
*
103+
* @param string|string[] $tags A tag or array of tags
104+
*
105+
* @return static
106+
*
107+
* @throws InvalidArgumentException When $tag is not valid.
101108
*/
102109
public function tag($tags)
103110
{

src/Symfony/Component/Cache/TaggedCacheItemInterface.php

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

0 commit comments

Comments
 (0)