We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42ddab0 commit 1d58ee6Copy full SHA for 1d58ee6
lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php
@@ -63,12 +63,10 @@ public function addTag(string $tagName): ExtendedCacheItemInterface
63
*/
64
public function setTags(array $tags): ExtendedCacheItemInterface
65
{
66
- if (\count($tags)) {
67
- if (\array_filter($tags, 'is_string')) {
68
- $this->tags = $tags;
69
- } else {
70
- throw new PhpfastcacheInvalidArgumentException('$tagName must be an array of string');
71
- }
+ if ($tags === [] || \array_filter($tags, 'is_string')) {
+ $this->tags = $tags;
+ } else {
+ throw new PhpfastcacheInvalidArgumentException('$tagName must be an array of string');
72
}
73
74
return $this;
0 commit comments