Skip to content

Commit 167c5ad

Browse files
committed
Merge pull request #5 from lbarulski/fix/cache-tags/uniq-values-repository
Add uniq repository tags
2 parents 6c8c82d + 0ab0ef8 commit 167c5ad

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

CacheTagsBundle/Listener/InvalidatorListener.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,9 @@ public function invalidate()
2828
{
2929
$tags = $this->repository->getTags();
3030

31-
$uniqTags = [];
3231
foreach ($tags as $tag)
3332
{
34-
$tagValue = $tag->getCacheTag();
35-
$uniqTags[$tagValue] = $tagValue;
36-
}
37-
38-
foreach ($uniqTags as $tagValue)
39-
{
40-
$this->invalidateTag($tagValue);
33+
$this->invalidateTag($tag->getCacheTag());
4134
}
4235
}
4336

CacheTagsBundle/Service/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Repository
2020
*/
2121
public function add(CacheTagInterface $tag)
2222
{
23-
$this->tags[] = $tag;
23+
$this->tags[$tag->getCacheTag()] = $tag;
2424
}
2525

2626
/**

0 commit comments

Comments
 (0)