Skip to content

Commit 8e92a91

Browse files
authored
Update cache.rst
*Using Cache Tags* section has invalid example. Should use TagAwareCacheInterface.
1 parent fc9fe33 commit 8e92a91

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cache.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,15 @@ to be able to invalidate the cache more efficient. One way to achieve that is to
486486
use cache tags. One or more tags could be added to the cache item. All items with
487487
the same key could be invalidate with one function call::
488488

489-
use Symfony\Contracts\Cache\ItemInterface;
489+
use Symfony\Contracts\Cache\TagAwareCacheInterface;
490490

491-
$value0 = $pool->get('item_0', function (ItemInterface $item) {
491+
$value0 = $pool->get('item_0', function (TagAwareCacheInterface $item) {
492492
$item->tag(['foo', 'bar'])
493493

494494
return 'debug';
495495
});
496496

497-
$value1 = $pool->get('item_1', function (ItemInterface $item) {
497+
$value1 = $pool->get('item_1', function (TagAwareCacheInterface $item) {
498498
$item->tag('foo')
499499

500500
return 'debug';

0 commit comments

Comments
 (0)