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] Fix denormalizing union types#45838
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
Merged
Merged
Uh oh!
There was an error while loading.Please reload this page.
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
T-bond commentedMar 24, 2022
ContributorAuthor
T-bond left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Self review done. All checks have passed.
Again, thanks for this great software! :)
Status: Reviewed
union types properlynicolas-grekas approved these changesMar 24, 2022
Member
nicolas-grekas commentedMar 24, 2022
Thank you@T-bond. |
This was referencedApr 2, 2022
Merged
Merged
Merged
Sign up for freeto 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.
@nicolas-grekas Replaces:#45824 as I accidentally registerred a lot of people to the notifier list when changing target branch.
Note about difference between docblock vs PHP 8 union types:
With PHP 8 union types, the resolved
$typesarray was always (when I checked) in the same order, no matter the type definition.So these two things:
public null|boolean|DateTimeandpublic DateTime|boolean|nullwouldalways generate an array, where thefirst item wasDateTime.With PHP docblock the
$tpyesarray order depends of the order of the documentation.So the
* @var \DateTime|bool|nullwould resolve to an array withDateTimeasfirst item, but the* @var null|bool|\DateTimewould resolve to theDateTimebeing thelast element.