-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Security] deprecate extending RememberMeDetails using legacy constructor signature
#61789
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
Conversation
xabbuh
commented
Sep 19, 2025
| Q | A |
|---|---|
| Branch? | 7.4 |
| Bug fix? | no |
| New feature? | yes |
| Deprecations? | no |
| Issues | |
| License | MIT |
RememberMeDetails class as final
RememberMeDetails class as finalRememberMeDetails class as final
RememberMeDetails class as finalRememberMeDetails class as final
|
I believe there is a general policy to not make value objects final if they don't have an interface (or at least back then). Making this class final means your custom |
|
An alternative solution I have in mind is triggering a deprecation in case the custom implementation has its own constructor but does not also override the two static factory methods. Otherwise we risk that custom implementations break in 8.0 with our new constructor signature. |
|
Although Wouter's rule make sense most of the times, I'm fine making this class final because I think the security-http API that exposes it doesn't make it a good extension point anyway. |
OK, on closer inspection I understand the motivation - having the constructor part of a public API since we're calling new |
RememberMeDetails class as finalRememberMeDetails using legacy constructor signature
dee44a8 to
fac9442
Compare
works as well, I updated the PR accordingly |
src/Symfony/Component/Security/Http/RememberMe/RememberMeDetails.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/RememberMe/RememberMeDetails.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/RememberMe/RememberMeDetails.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Tests/RememberMe/RememberMeDetailsTest.php
Show resolved
Hide resolved
|
Thank you @xabbuh. |