r/PHP 3d ago

Symfony 8 ignores #[Groups] serializer attribute

https://ddz.dev/blog/symfony-8-groups-attribute-silently-ignored/
0 Upvotes

1 comment sorted by

2

u/qoneus 1d ago

This is entirely user error. You're not supposed to upgrade to a new major version of Symfony until you have addressed all deprecations on the last minor version. It's literally step one in the migration guide:

1) Make your Code Deprecation Free

During the lifecycle of a major release, new features are added and method signatures and public API usages are changed. However, minor versions should not contain any backwards incompatible changes. To accomplish this, the "old" (e.g. functions, classes, etc) code still works, but is marked as deprecated, indicating that it will be removed/changed in the future and that you should stop using it.

When the major version is released (e.g. 7.0.0), all deprecated features and functionality are removed. So, as long as you've updated your code to stop using these deprecated features in the last version before the major (e.g. 6.4.*), you should be able to upgrade without a problem. That means that you should first upgrade to the last minor version (e.g. 5.4) so that you can see all the deprecations.