-
Notifications
You must be signed in to change notification settings - Fork 111
[symfony 7] update sets #890
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
33d9659 to
e783699
Compare
| public function getRuleDefinition(): RuleDefinition | ||
| { | ||
| return new RuleDefinition( | ||
| 'Remove unused UserInterface::eraseCredentials() method, make it part of serialize if needed', |
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.
The method is still necessary in sf 7.x, because it is still part of the interface. Without the method you get an exception:
Class App\Entity\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Component\Security\Core\User\UserInterface::eraseCredentials)
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 see. Where would you place it?
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 think the method should be removed by a sf8 rule. the sf7 rule should keep the empty method with a #[Deprecated] attribute, because this prevents the deprecation notice in symfony:
This PR leverages the new #[\Deprecated] attribute to decide if some eraseCredentials() method is to be called or not.
My target DX here is to save us all (the community) from having to add erase_credentials: false configuration in all our apps.
So, instead of having to opt-out from the deprecation using this config option, the opt-out is done by adding the attribute on the method:
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. Could you move the rule to SF8?
Resources