Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Serializer] Use DenormalizerAwareInterface instead of SerializerAwareInterface#52764
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The UnwrappingDenormalizer does not depend on the SerializerInterface.Using the DenormalizerInterfacce is enough, because only denormalize is called.Also, the SerializerInterface does not define method denormalize and it currently only works,because at runtime the serializer service is injected, which implements the DenormalizerInterface.
This is a breaking change that we need a deprecation layer for. By removing |
Hi@derrabus,
You are right, I missed this. I am going to add a deprecation layer. |
94663b7
toc4542ef
Comparec4542ef
to4dea4e0
CompareUh oh!
There was an error while loading.Please reload this page.
/** | ||
* @author Eduard Bulava <bulavaeduard@gmail.com> | ||
*/ | ||
final class UnwrappingDenormalizer implements DenormalizerInterface, SerializerAwareInterface |
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 we should keepSerializerAwareInterface
as long as we implementsetSerializer()
.
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.
If we implement SerializerAwareInterface, the Serializer class will be calling the deprecated method.
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, that's the reason why I removedSerializerAwareInterface
. TheSerializer
class will callsetSerializer()
here:https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/Serializer/Serializer.php#L85
But without it, its a bc-break for code relying onUnwrappingDenormalizer
implementingSerializerAwareInterface
. I am not sure how to solve this problem.
Uh oh!
There was an error while loading.Please reload this page.
The
UnwrappingDenormalizer
does not depend on theSerializerInterface
. Using theDenormalizerInterfacce
is enough, because onlydenormalize()
is called. Also, theSerializerInterface
does not define methoddenormalize()
and it currently only works, because at runtime theserializer
service is injected, which implements theDenormalizerInterface
.