Skip to content

Commit a580ce0

Browse files
authored
Fix for PurgeTagsListener: checking existence of Psr6StoreInterface incorrect
I tried using the PurgeTagsListener but after successfully installing (composer requiring) the toflar/psr6-symfony-http-cache-store package and including the PurgeTagsListener in my AppCache.php I was hitting the Exception from Line 60: 'Cache tag invalidation only works with the toflar/psr6-symfony-http-cache-store package. See "Symfony HttpCache Configuration" in the documentation.' Solution: Either use 1. "interface_exists(Psr6StoreInterface::class)" or 2. "class_exists(Psr6Store::class)" to successfully check for existence of package. Decided for 1. in this pull request.
1 parent 60b4e2b commit a580ce0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SymfonyCache/PurgeTagsListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PurgeTagsListener extends AccessControlledListener
5656
*/
5757
public function __construct(array $options = [])
5858
{
59-
if (!class_exists(Psr6StoreInterface::class)) {
59+
if (!interface_exists(Psr6StoreInterface::class)) {
6060
throw new \Exception('Cache tag invalidation only works with the toflar/psr6-symfony-http-cache-store package. See "Symfony HttpCache Configuration" in the documentation.');
6161
}
6262
parent::__construct($options);

0 commit comments

Comments
 (0)