-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[JsonEncoder] Replace normalizers by value transformers #59290
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
Conversation
3c5af0a to
0b105a9
Compare
0b105a9 to
877fba3
Compare
|
Looks like psalm made a good point |
|
Yep, I'm on it! |
93a0d7b to
0968e58
Compare
src/Symfony/Component/JsonEncoder/Attribute/ValueTransformer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/JsonEncoder/Attribute/ValueTransformer.php
Outdated
Show resolved
Hide resolved
0968e58 to
ebb3601
Compare
nicolas-grekas
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.
toPhp or toNative?
what's the requirements of the value returned by toJson (which is going to be a PHP value ;) )
src/Symfony/Component/JsonEncoder/ValueTransformer/DateTimeValueTransformer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/JsonEncoder/ValueTransformer/DateTimeValueTransformer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/JsonEncoder/ValueTransformer/DateTimeValueTransformer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/JsonEncoder/ValueTransformer/ValueTransformerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/JsonEncoder/Tests/ValueTransformer/DateTimeValueTransformerTest.php
Outdated
Show resolved
Hide resolved
01c0880 to
906e354
Compare
src/Symfony/Component/JsonEncoder/Attribute/ValueTransformer.php
Outdated
Show resolved
Hide resolved
7f848d9 to
2049277
Compare
|
If I get it right, the PR header needs an update, right? |
|
Indeed, you're right, updated! |
|
(rebase needed) |
2049277 to
abe4ec9
Compare
507d527 to
2b64dcd
Compare
src/Symfony/Component/JsonEncoder/Attribute/ValueTransformer.php
Outdated
Show resolved
Hide resolved
nicolas-grekas
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.
just one phpdoc thing and LGTM, thanks.
2b64dcd to
ced7191
Compare
|
Thank you @mtarld. |
This PR was merged into the 7.3 branch. Discussion ---------- [JsonStreamer] also reject `\DateTime` subclasses | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | following #59290 (comment) | License | MIT Commits ------- 0d6cda3 also reject \DateTime subclasses
For a better DX and to avoid confusion with Serializer's normalizers and denormalizers:
NormalizerInterfaceandDenormalizerInterfaceto a singleValueTransformerInterface:NormalizerandDenormalizerattributes by a singleValueTransformerattribute:/cc @wouterj