-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Throw exception if incompatible version of psr/simple-cache is used #45096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cache] Throw exception if incompatible version of psr/simple-cache is used #45096
Conversation
2d39028
to
f725fe7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should check the return type of a method of the CacheInterface
instead.
f725fe7
to
9a72912
Compare
@@ -11,6 +11,7 @@ | |||
|
|||
namespace Symfony\Component\Cache; | |||
|
|||
use Composer\InstalledVersions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use 3.0+ as version number and drop using this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! Fixed and force-pushed :)
9a72912
to
e35ad89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.