-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fabpot
merged 1 commit into
symfony:6.1
from
mtarld:fix/deprecate-context-aware-interfaces
Jan 9, 2022
Merged
[Messenger][Serializer] Deprecate "context aware" interfaces #43982
fabpot
merged 1 commit into
symfony:6.1
from
mtarld:fix/deprecate-context-aware-interfaces
Jan 9, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd5d7c5
to
f671ec2
Compare
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
approved these changes
Nov 9, 2021
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!
ogizanagi
approved these changes
Nov 9, 2021
f671ec2
to
979ec87
Compare
nicolas-grekas
requested changes
Dec 25, 2021
979ec87
to
b81e087
Compare
chalasr
approved these changes
Jan 7, 2022
b81e087
to
ab72f80
Compare
fabpot
approved these changes
Jan 9, 2022
Thank you @mtarld. |
Merged
mbrodala
added a commit
to mbrodala/PhpEnums
that referenced
this pull request
Jul 5, 2022
ogizanagi
added a commit
to Elao/PhpEnums
that referenced
this pull request
Jul 11, 2022
This PR was merged into the 1.x-dev branch. Discussion ---------- Add context to (de)normalizer support check See symfony/symfony#43982 Commits ------- ab69eab Add context to (de)normalizer support check
chalasr
added a commit
that referenced
this pull request
Aug 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` FYI Commits ------- 9ac7fb1 [Serializer] Revert deprecation of `ContextAwareEncoderInterface` and `ContextAwareDecoderInterface`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
ContextAwareNormalizerInterface
ContextAwareDenormalizerInterface
ContextAwareEncoderInterface
ContextAwareDecoderInterface
But right now, thanks to the
DebugClassLoader
, 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).