Skip to content

Commit e3eeffc

Browse files
a.dmitryuknicolas-grekas
authored andcommitted
[Cache] Add TagAwareAdapterInterface to NullAdapter
1 parent a16ba03 commit e3eeffc

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* @author Titouan Galopin <[email protected]>
2121
*/
22-
class NullAdapter implements AdapterInterface, CacheInterface, NamespacedPoolInterface
22+
class NullAdapter implements AdapterInterface, CacheInterface, NamespacedPoolInterface, TagAwareAdapterInterface
2323
{
2424
private static \Closure $createCacheItem;
2525

@@ -108,4 +108,9 @@ private function generateItems(array $keys): \Generator
108108
yield $key => $f($key);
109109
}
110110
}
111+
112+
public function invalidateTags(array $tags): bool
113+
{
114+
return true;
115+
}
111116
}

src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,11 @@ public function testCommit()
138138
$this->assertTrue($adapter->saveDeferred($item));
139139
$this->assertTrue($this->createCachePool()->commit());
140140
}
141+
142+
public function testInvalidateTags()
143+
{
144+
$adapter = $this->createCachePool();
145+
146+
self::assertTrue($adapter->invalidateTags(['foo']));
147+
}
141148
}

src/Symfony/Component/Config/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.4
5+
---
6+
7+
* Add TagAwareAdapterInterface to NullAdapter
8+
49
7.3
510
---
611

0 commit comments

Comments
 (0)