Skip to content

[SecurityBundle] Add service alias for legacy Security helper #46602

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

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented Jun 6, 2022

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? yes
Tickets -
License MIT
Doc PR -

The service alias for Symfony\Component\Security\Core\Security was removed in #46094 which causes existing code to break when upgrading to 6.2, eg:

use Symfony\Component\Security\Core\Security;

class HomeController extends AbstractController
{
    public function __construct(private Security $security)
    {
    }
}

results in:
image

@chalasr
Copy link
Member

chalasr commented Jun 6, 2022

You still get a TypeError with the patch, isn't it?
Answer: no, I made the new class extends the deprecated one.

@chalasr
Copy link
Member

chalasr commented Jun 6, 2022

Good catch, thanks @HypeMC.

@chalasr chalasr merged commit a1d6134 into symfony:6.2 Jun 6, 2022
@HypeMC HypeMC deleted the add-legacy-security-alias branch June 6, 2022 17:47
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.

3 participants