-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer][PropertyInfo] Fix support for "false" built-in type on PHP 8.2 #45981
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][PropertyInfo] Fix support for "false" built-in type on PHP 8.2 #45981
Conversation
cd0d551
to
3c4de50
Compare
9512543
to
d915fe4
Compare
Thanks for PR. Can we wait for https://wiki.php.net/rfc/true-type RFC also? |
I planned to do it as soon as it is merged if this PR is merged before "true" is available, but yeah I can definitely embed it as well in this pull request 👍 |
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.
Works for me, with minor comments, thanks.
(true
should wait until the RFC is approved)
d915fe4
to
3b55f99
Compare
@alexandre-daubois Can you update the PropertyInfo's conflict rule + dev requirement for symfony/serializer so that it only allows serializer v4.4.42 or higher? That should fix the low-deps build |
I'll take a look into that as soon as possible! |
f074bda
to
1e4f810
Compare
Wait, it's the opposite actually 🤦♂️ Serializer needs |
1e4f810
to
bfb1146
Compare
Right, makes more sense 😄 At least, I figured out what are high-deps/low-deps builds. Thank you Robin! |
bfb1146
to
0a32f04
Compare
@@ -483,7 +483,7 @@ private function validateAndDenormalize(string $currentClass, string $attribute, | |||
return (float) $data; | |||
} | |||
|
|||
if (('is_'.$builtinType)($data)) { | |||
if ('false' === $builtinType || ('is_'.$builtinType)($data)) { |
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.
I've inlined the value of the constant: the minimum version bump is not worth it IMHO.
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.
Alright, will do it as well for php/php-src#8326 when it's accepted. Thanks 👍
/** | ||
* @requires PHP 8.2 | ||
*/ | ||
public function testFalseBuiltInTypes() |
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.
This test case was triggering a warning: This test did not perform any assertions
I fixed it.
Thank you @alexandre-daubois. |
0a32f04
to
4187d3f
Compare
…HP 8.2) (bobahvas, alexandre-daubois) This PR was merged into the 6.2 branch. Discussion ---------- [Serializer] Add support of true built-in type (from PHP 8.2) | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - RFC: https://wiki.php.net/rfc/true-type Pull request: php/php-src#8326 Same as this PR to add support of `false` and `null` types: #45981 Commits ------- 2ec0453 [Serializer] Add support of true built-in type (from PHP 8.2)
false
andnull
built-in types have been merged in PHP 8.2 a few hours ago: php/php-src#7546 🎉RFC: https://wiki.php.net/rfc/null-false-standalone-types
PropertyInfo and Serializer both need an update to support them.