[Cache] Throw exception if incompatible version of psr/simple-cache is used#45096
Conversation
2d39028 to
f725fe7
Compare
derrabus
left a comment
There was a problem hiding this comment.
I wonder if we should check the return type of a method of the CacheInterface instead.
f725fe7 to
9a72912
Compare
|
|
||
| namespace Symfony\Component\Cache; | ||
|
|
||
| use Composer\InstalledVersions; |
There was a problem hiding this comment.
Let's use 3.0+ as version number and drop using this class
There was a problem hiding this comment.
Sounds good! Fixed and force-pushed :)
9a72912 to
e35ad89
Compare
nicolas-grekas
left a comment
There was a problem hiding this comment.
LGTM.
Can you please confirm that this effectively improves the situation by giving the patch a try on the case you had?
Performing a quick test directly within the component's source directory shows that the exception is indeed only thrown when psr/simple-cache 3.0 is installed: This does not prevent the installation of the conflicting version as I originally hoped (and thus the oddly-named feature branch here), but it at least provides a clear explanation of what's wrong and how to correct it, which is good enough for me and my library's users :) |
|
Thank you @colinodell. |
|
Code reverted on 6.0+ |

Addresses #44738 by throwing an explanatory exception when an incompatible version of psr/simple-log is used.
❗ Important: This change should not be included in 6.0+, as those newer versions do not have this compatibility issue! This commit should instead be reverted during that merge.