Navigation Menu

Skip to content
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

[Serializer] Fix denormalization of object with typed constructor arg (not castable) and with COLLECT_DENORMALIZATION_ERRORS #50024

Merged
merged 1 commit into from Apr 15, 2023

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Apr 15, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

There is already a test for constructor instantiation but it worked "by chance".
The test is testCollectDenormalizationErrorsWithConstructor.
It worked because $reflectionClass->newInstanceArgs($params) works if
one give a string value that should fit in a bool type. PHP casts
automatically the value for us. (see: https://3v4l.org/GYr0T)

Now we ensure to not throw an exception if the instantiation cannot be
done. The mismatch is already collected few lines above, so there
nothing to do more

… (not castable) and with COLLECT_DENORMALIZATION_ERRORS
@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

@nicolas-grekas nicolas-grekas merged commit 49de027 into symfony:5.4 Apr 15, 2023
7 of 11 checks passed
@lyrixx lyrixx deleted the seria-collect-cpp branch April 15, 2023 18:17
This was referenced Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants