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

[Messenger][Serializer] Deprecate "context aware" interfaces#43982

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

Merged

Conversation

@mtarld
Copy link
Contributor

@mtarldmtarld commentedNov 9, 2021
edited
Loading

QA
Branch?6.1
Bug fix?no
New feature?no
Deprecations?yes
Tickets
LicenseMIT
Doc PRTODO

Insupports* methods, we are really often relying on serialization context.
Previously (~2017), in order to have the context in these methods (and be BC compatible), new interfaces were introduced:

  • ContextAwareNormalizerInterface
  • ContextAwareDenormalizerInterface
  • ContextAwareEncoderInterface
  • ContextAwareDecoderInterface

But right now, thanks to theDebugClassLoader, we're able to have an upgrade path where the regular interfaces:

  • NormalizerInterface
  • DenormalizerInterface
  • EncoderInterface
  • DecoderInterface
    can be updated to rely on the serialization context.

Therefore, the "context aware" interfaces could be deprecated in favor of "regular" ones (and then save 4 interfaces in 7.0).

ro0NL, ismail1432, maxhelias, dunglas, and chalasr reacted with thumbs up emojiro0NL reacted with heart emoji
@carsonbotcarsonbot added this to the6.0 milestoneNov 9, 2021
@carsonbotcarsonbot changed the title[Serializer][Messenger] Deprecate "context aware" interfaces[Messenger][Serializer] Deprecate "context aware" interfacesNov 9, 2021
@mtarldmtarldforce-pushed thefix/deprecate-context-aware-interfaces branch fromdd5d7c5 tof671ec2CompareNovember 9, 2021 17:44
@mtarld
Copy link
ContributorAuthor

fabbot.io isn't happy because I touched toXmlEncoder:

-        throw new NotEncodableValueException('An unexpected value could not be serialized: '.(!\is_resource($data) ? var_export($data, true) : sprintf('%s resource', get_resource_type($data))));+        throw new NotEncodableValueException('An unexpected value could not be serialized: '.(!\is_resource($data) ? var_export($data, true) : sprintf('"%s" resource', get_resource_type($data))));

But this isn't related to the current PR.

Copy link
Member

@dunglasdunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM!

@mtarldmtarld changed the base branch from6.0 to6.1December 24, 2021 09:29
@mtarldmtarldforce-pushed thefix/deprecate-context-aware-interfaces branch fromf671ec2 to979ec87CompareDecember 24, 2021 10:03
@mtarldmtarldforce-pushed thefix/deprecate-context-aware-interfaces branch from979ec87 tob81e087CompareJanuary 7, 2022 11:40
@mtarldmtarldforce-pushed thefix/deprecate-context-aware-interfaces branch fromb81e087 toab72f80CompareJanuary 7, 2022 12:45
@fabpot
Copy link
Member

Thank you@mtarld.

@mtarldmtarld deleted the fix/deprecate-context-aware-interfaces branchJanuary 10, 2022 08:33
@fabpotfabpot mentioned this pull requestApr 15, 2022
mbrodala added a commit to mbrodala/PhpEnums that referenced this pull requestJul 5, 2022
ogizanagi added a commit to Elao/PhpEnums that referenced this pull requestJul 11, 2022
This PR was merged into the 1.x-dev branch.Discussion----------Add context to (de)normalizer support checkSeesymfony/symfony#43982Commits-------ab69eab Add context to (de)normalizer support check
chalasr added a commit that referenced this pull requestAug 21, 2022
…erface` and `ContextAwareDecoderInterface` (nicolas-grekas)This PR was merged into the 6.1 branch.Discussion----------[Serializer] Revert deprecation of `ContextAwareEncoderInterface` and `ContextAwareDecoderInterface`| Q             | A| ------------- | ---| Branch?       | 6.1| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -While reviewing#43231, I figured out that the correct fix for#38270 was to make `ChainEncoder` properly consider `ContextAwareEncoderInterface` when deciding to cache or not.Since this interface is useful to discriminate the cache/no-cache situations, we have to undeprecate it (from#43982.)/cc `@Guite` and `@mtarld` FYICommits-------9ac7fb1 [Serializer] Revert deprecation of `ContextAwareEncoderInterface` and `ContextAwareDecoderInterface`
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas requested changes

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.1

Development

Successfully merging this pull request may close these issues.

7 participants

@mtarld@fabpot@dunglas@nicolas-grekas@ogizanagi@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp