-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Array of union types is not extracted correctly #50891
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
Comments
Can you try to use |
It works, thank you! 👍
Is it by design? Or just a bug? I found this code in
I assume when it was implemented -
|
Hey, thanks for your report! |
Friendly ping? Should this still be open? I will close if I don't hear anything. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Symfony version(s) affected
6.2.8
Description
Types like
array<int|string>
are not processed correctly, collection type is defined as array of Object "(int|string)", but should be array of (int or string)How to reproduce
Define class with a property
array $property
, add type in docblock, array value type should be a union, for example int|string. For examplearray<int|string>
or(int|string)[]
Use
PropertyInfoExtractor
withPhpDocExtractor
to get property typesYou'll get
Weird part is
-builtinType: "object"
,-class: "(int|string)"
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: