Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dd5d7c5 tof671ec2Comparemtarld commentedNov 9, 2021
fabbot.io isn't happy because I touched to - 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. |
dunglas left a comment
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.
LGTM!
f671ec2 to979ec87CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
979ec87 tob81e087Compareb81e087 toab72f80Comparefabpot commentedJan 9, 2022
Thank you@mtarld. |
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
…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`
Uh oh!
There was an error while loading.Please reload this page.
In
supports*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:
ContextAwareNormalizerInterfaceContextAwareDenormalizerInterfaceContextAwareEncoderInterfaceContextAwareDecoderInterfaceBut right now, thanks to the
DebugClassLoader, we're able to have an upgrade path where the regular interfaces:NormalizerInterfaceDenormalizerInterfaceEncoderInterfaceDecoderInterfacecan 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).