Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer] AddDateTimeNormalizer::CAST_KEY context option#53056
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
[Serializer] AddDateTimeNormalizer::CAST_KEY context option#53056
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d45ef9a tofb671a2Comparesrc/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Context/Normalizer/DateTimeNormalizerContextBuilder.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Context/Normalizer/DateTimeNormalizerContextBuilder.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fb671a2 tof2e8ba2Comparenorkunas commentedDec 15, 2023
@mtarld I've updated, is this what you had in mind with deprecation? |
39809e2 toaa8cf48Comparesrc/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
dc03538 tob3d55dfCompareb3d55df tobae7e35Comparenorkunas commentedDec 20, 2023
Should I skip those test cases on 32bit systems when value is > PHP_INT_MAX? |
src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
derrabus commentedDec 20, 2023
Either that or skip the int cast on those systems. |
969e59b to0c85461CompareDateTimeNormalizer::CAST_KEY context optionnorkunas commentedJan 5, 2024
Anybody to review? |
mtarld 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.
Code looks good to me. But I'm wondering that maybe we can add a check to make sure that the cast value is consistent with the format? So that it won't be possible to castd/m/Y to anint for example. WDYT?
norkunas commentedJan 13, 2024
But then we would go back to format guessing, which derrabus wanted to avoid :) |
mtarld commentedJan 13, 2024
Oh yeah, I missed that part... Thanks, LGTM then! |
0c85461 toe5e925eComparefabpot commentedFeb 3, 2024
Thank you@norkunas. |
…ontext option (SzymonKaminski)This PR was merged into the 7.1 branch.Discussion----------[Serializer] Document `DateTimeNormalizer::CAST_KEY` context optionPR documents new context option `CAST_KEY` of `DateTimeNormalizer` that allows to cast objects to integers or floats.Resolves#19485Feature PR:symfony/symfony#53056Commits-------5495c1d [Serializer] Document DateTimeNormalizer::CAST_KEY context option
Uh oh!
There was an error while loading.Please reload this page.
This adds
DateTimeNormalizer::CAST_KEYcontext option allowing to cast the formatted result tointorfloat.