Skip to content
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

[Security] Readd deprecated methods to the interfaces #41493

Merged
merged 1 commit into from Jun 2, 2021

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Jun 1, 2021

Q A
Branch? 5.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #41470
License MIT
Doc PR n/a

Readd the deprecated methods to the interface, to make sure third party packages <5.3 work with objects created using the 5.3+ interfaces.

I've tested in a project and the deprecation is not triggered when implementing the method, only when calling. So this should still allow applications to be deprecation free in 5.4.

alongosz added a commit to ezsystems/ezplatform-kernel that referenced this pull request Jun 2, 2021
For more details see symfony/symfony#41493

Additionally removed symfony/cache conflicts as they no longer apply
(we're requiring ^5.2.0)
@fabpot
Copy link
Member

fabpot commented Jun 2, 2021

Thank you @wouterj.

@fabpot fabpot merged commit e6510a0 into symfony:5.3 Jun 2, 2021
@wouterj wouterj deleted the issue-41470/username-bc branch June 2, 2021 09:35
@fabpot fabpot mentioned this pull request Jun 2, 2021
@Pixelshaped
Copy link

In my User I had to readd the old method:

    /**
     * A visual identifier that represents this user.
     *
     * @see UserInterface
     */
    public function getUserIdentifier(): string
    {
        return (string) $this->email;
    }

    /**
     * @deprecated in Symfony 5.3
     */
    public function getUsername(): string
    {
        return $this->getUserIdentifier();
    }

As I understand it, I could remove the new method that will be re-introduced for the 6.0 BC?

@stof
Copy link
Member

stof commented Jun 2, 2021

yeah, the getUsername will be removed from the interface in 6.0 (and so you will be able to remove it from your class implementing the interface). Deprecation-free code won't use this method in 5.3+ (using getUserIdentifier instead)

@derrabus
Copy link
Member

derrabus commented Jun 2, 2021

As I understand it, I could remove the new method that will be re-introduced for the 6.0 BC?

Don't remove the new method. Keep both methods for now and drop getUsername() once you migrate to Symfony 6.

jrushlow pushed a commit to wouterj/maker-bundle that referenced this pull request Jun 6, 2021
jrushlow pushed a commit to wouterj/maker-bundle that referenced this pull request Jun 8, 2021
weaverryan added a commit to symfony/maker-bundle that referenced this pull request Jun 18, 2021
…outerj, weaverryan)

This PR was merged into the 1.0-dev branch.

Discussion
----------

[make:user] Keep implementing deprecated username methods

This updates the makers for symfony/symfony#41493 (where these methods are reintroduced to the interface for 5.3.1)

Commits
-------

2d9312e Fix tests
bd55d19 Update src/Resources/skeleton/security/UserProvider.tpl.php
c3d4046 Still implement deprecated username method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants