-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Serializer] Use NormalizerInterface
instead of ObjectNormalizer
#18779
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
Conversation
serializer/custom_normalizer.rst
Outdated
|
||
class TopicNormalizer implements NormalizerInterface | ||
{ | ||
public function __construct( | ||
private UrlGeneratorInterface $router, | ||
private ObjectNormalizer $normalizer, | ||
private NormalizerInterface $normalizer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this leads to a cyclic dependency, if I remember correctly when I documented something similar 🤔 You may base yourself on those ones I think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, if forgot about that part, I copied the #18602 PR contents, thanks!
Btw, this is deprecated since 6.1 (and not 6.4), should we update the 6.4 branch as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes, I guess this may be managed during upmerge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we will handle it while unmerging this PR 👍
e4c705b
to
07280cd
Compare
NormalizerInterface
instead of ObjectNormalizer
@OskarStark if you think this is ready, please merge it. I don't feel confident merging things related to the serializer. Thanks! |
07280cd
to
3e9af1b
Compare
Thank you @mtarld. |
As mentioned in symfony/maker-bundle#1252 (comment), the documentation is telling to use a concrete implementation of the
NormalizerInteface
.This is not the best in terms of OOP, and moreover doesn't work since Symfony 6.1 and the introduction of
TraceableNormalizer
.