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: DI Extension deprecated since Symfony 7.1 #8187

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

AirBair
Copy link
Contributor

@AirBair AirBair commented Jun 17, 2024

Subject

Since 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 "Sonata\AdminBundle\DependencyInjection\SonataAdminExtension".

Related Symfony PR: symfony/symfony#53801

I am targeting this branch, because these changes are BC.

Changelog

### Fixed
- Symfony 7.1 deprecation about `Symfony\Component\HttpKernel\DependencyInjection\Extension` usage

Other bundles like SonataBlockExtension, SonataFormExtension, etc. have the same deprecation, will take care of them if this proposed fix is ok for you.

VincentLanglet
VincentLanglet previously approved these changes Jun 17, 2024
@VincentLanglet
Copy link
Member

Can you also bump the rector version in the composer.json ? It will fix the rector CI.

@VincentLanglet VincentLanglet merged commit 6c6106a into sonata-project:4.x Jun 17, 2024
20 of 23 checks passed
@VincentLanglet
Copy link
Member

Thanks

@@ -16,7 +16,7 @@
use Sonata\AdminBundle\FieldDescription\FieldDescriptionInterface;
use Sonata\AdminBundle\Templating\TemplateRegistryInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Extension\Extension;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we have something to prevent about this change. but technically, this is a BC break.
The replacing class does not inherit the deprecated class.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought it was... Dunno why it wasnt done this way to help BC...
Is it worth a BC layer then ?

Shouldn't our DependencyInjection/Extension file be marked as internal ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with marking our own DI extension as internal. AFAIK, we haven't defined any extension point here (but we should check, I'm just talking from what I remember).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AbstractSonataAdminExtension is used in other bundle and could technically be used by someone else for a custom persistence bundle...
https://github.com/search?q=org%3Asonata-project%20AbstractSonataAdminExtension&type=code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants