8000 Throw exception if incompatible version of psr/simple-cache is used · symfony/symfony@9a72912 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a72912

Browse files
committed
Throw exception if incompatible version of psr/simple-cache is used
1 parent b8656d4 commit 9a72912

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Cache/Psr16Cache.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache;
1313

14+
use Composer\InstalledVersions;
1415
use Psr\Cache\CacheException as Psr6CacheException;
1516
use Psr\Cache\CacheItemPoolInterface;
1617
use Psr\SimpleCache\CacheException as SimpleCacheException;
@@ -19,6 +20,10 @@
1920
use Symfony\Component\Cache\Exception\InvalidArgumentException;
2021
use Symfony\Component\Cache\Traits\ProxyTrait;
2122

23+
if (null !== (new \ReflectionMethod(CacheInterface::class, 'get'))->getReturnType()) {
24+
throw new \LogicException(sprintf('psr/simple-cache "%s" is not compatible with this version of symfony/cache. Please upgrade symfony/cache to 6.0+ or downgrade psr/simple-cache to v1.x or 2.x.', InstalledVersions::getPrettyVersion('psr/simple-cache')));
25+
}
26+
2227
/**
2328
* Turns a PSR-6 cache into a PSR-16 one.
2429
*

0 commit comments

Comments
 (0)
0