Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Open
jschaedl wants to merge4 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromjschaedl:unwrappin-denormalizer

Conversation

jschaedl
Copy link
Contributor

QA
Branch?7.1
Bug fix?no
New feature?no
Deprecations?no
Issues-
LicenseMIT

TheUnwrappingDenormalizer 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.

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.
@jschaedljschaedl changed the titleUse DenormalizerAwareInterface instead of SerializerAwareInterface[Serializer] Use DenormalizerAwareInterface instead of SerializerAwareInterfaceNov 27, 2023
@carsonbotcarsonbot changed the title[Serializer] Use DenormalizerAwareInterface instead of SerializerAwareInterfaceUse DenormalizerAwareInterface instead of SerializerAwareInterfaceNov 27, 2023
@carsonbotcarsonbot added this to the7.1 milestoneNov 27, 2023
@derrabus
Copy link
Member

This is a breaking change that we need a deprecation layer for. By removingSerializerAwareInterface/SerializerAwareTrait from this class, we're effectively removing a public method from that class.

jschaedl reacted with thumbs up emoji

@jschaedl
Copy link
ContributorAuthor

Hi@derrabus,

This is a breaking change that we need a deprecation layer for. By removing SerializerAwareInterface/SerializerAwareTrait from this class, we're effectively removing a public method from that class.

You are right, I missed this. I am going to add a deprecation layer.


/**
* @author Eduard Bulava <bulavaeduard@gmail.com>
*/
final class UnwrappingDenormalizer implements DenormalizerInterface, SerializerAwareInterface
Copy link
Member

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().

Copy link
Member

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.

derrabus reacted with confused emoji
Copy link
ContributorAuthor

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.

@carsonbotcarsonbot changed the titleUse DenormalizerAwareInterface instead of SerializerAwareInterface[Serializer] Use DenormalizerAwareInterface instead of SerializerAwareInterfaceMay 15, 2024
@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

@derrabusderrabusderrabus requested changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

6 participants
@jschaedl@derrabus@stof@fabpot@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp