Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Nov 29, 2025

@TomasVotruba TomasVotruba changed the title tv symfony 7 series [symfony 7] update sets Nov 29, 2025
@TomasVotruba TomasVotruba merged commit 7b1246e into main Nov 30, 2025
6 checks passed
@TomasVotruba TomasVotruba deleted the tv-symfony-7-series branch November 30, 2025 21:11
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Remove unused UserInterface::eraseCredentials() method, make it part of serialize if needed',
Copy link
Contributor

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)

Copy link
Member Author

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?

Copy link
Contributor

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:

symfony/symfony#59682

Copy link
Member Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants