stof / StofDoctrineExtensionsBundle

Integration bundle for DoctrineExtensions by l3pp4rd in Symfony
https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/index.html
MIT License
1.89k stars 380 forks source link

Support Symfony 7, Switch doctrine suubscribers to #[AsDoctrineListener] #461

Closed tacman closed 10 months ago

tacman commented 10 months ago

Symfony 7 is in beta now. First step is removing deprecations.

!! 2023-10-23T10:58:50+00:00 [info] User Deprecated: Since symfony/doctrine-bridge 6.3: Registering "Gedmo\Timestampable\TimestampableListener" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.

While this fix, for example, is easy, the minimum requirements in composer.json is 6.0. I think it should be higher than that, but that might not be enough. Since support for PHP 7 was dropped 3 months ago, is it safe to switch to attributes and start fixing the deprecations?

stof commented 10 months ago

The version 1.8.0 of the bundle already stopped registering the listeners as subscribers (this was not done by switching to attributes as the classes are not part of the bundle, but the result is the same).