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

Fix extension deprecation #10

Closed
ehymel opened this issue Jun 15, 2024 · 5 comments · Fixed by #11
Closed

Fix extension deprecation #10

ehymel opened this issue Jun 15, 2024 · 5 comments · Fixed by #11

Comments

@ehymel
Copy link

ehymel commented Jun 15, 2024

In your DependencyInjection/TwoFactorTextExtension.php file, line 11 is triggering a deprecation in symfony 7.1:

The "Symfony\Component\HttpKernel\DependencyInjection\Extension" class is considered internal since Symfony 7.1, to be deprecated in 8.1; use Symfony\Component\DependencyInjection\Extension\Extension instead. It may change without further notice. You should not use it from "Erkens\Security\TwoFactorTextBundle\DependencyInjection\TwoFactorTextExtension".

This can be fixed by changing from
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
to
use Symfony\Component\DependencyInjection\Extension\Extension;

@erkens
Copy link
Owner

erkens commented Jun 17, 2024

Thanks for pointing it out, I will update this ofcourse.
ButI'm not sure if this "fix" is also correct for Symfony 5.4 which is supported through via scheb/2fa-bundle 6.0.

Ofcource I can make a new major release and only support Symfony > 7.1, but to do this only for a small deprecation message (and for now Symfony 8 will be another 1,5 year I think?).. So I'm in doubt to do this now at this moment.

Any thoughts?

@ehymel
Copy link
Author

ehymel commented Jun 17, 2024

Fair point, and a tough call to make.

For what it's worth, scheb/2fa fixed this deprecation a week ago (see here) for their version 7.3.

Probably not worth the effort, but I suppose you could run 2 parallel versions, as in 2.x for scheb/2fa-bundle through version 6 and 3.x for version 7+

@erkens
Copy link
Owner

erkens commented Jun 17, 2024

That was what I had in mind, release it with only support for scheb/2fa > 7.3
But I don't like to maintain multiple versions, and I'm still using this on a Symfony 5.4 application.

@erkens
Copy link
Owner

erkens commented Jun 17, 2024

Probably not worth the effort, but I suppose you could run 2 parallel versions, as in 2.x for scheb/2fa-bundle through version 6 and 3.x for version 7+

Maybe not worth the effort, but I did just that. I already had a branch for v1, so no also for v2. And I don't think there are many changes to made in the future, this isn't a large library after all :D

@ehymel
Copy link
Author

ehymel commented Jun 17, 2024

Thanks!

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 a pull request may close this issue.

2 participants