-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TypeInfo] Fix handling ConstFetchNode
#60820
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
base: 7.2
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Hmm, this is not the right fix :( |
38d6ac6
to
526b002
Compare
526b002
to
6e237a9
Compare
Changed implementation from returning |
Constants are not even restricted to scalars in recent PHP versions. The right fix would involve looking at the fetched constants. |
ConstFetchNode
6e237a9
to
48f648b
Compare
I've updated implementation |
4173b66
to
606a4ab
Compare
606a4ab
to
3d5c90d
Compare
if (preg_match('/^'.str_replace('\*', '.*', preg_quote($node->constExpr->name, '/')).'$/', $const->getName())) { | ||
$constValue = $const->getValue(); | ||
|
||
$types[] = match (true) { |
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.
Maybe you can use Type::fromValue()
instead? And then merge types with CollectionType::mergeCollectionValueTypes()
helper method?
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 wanted, but it's not available in 7.2
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.
Oh indeed, then it might be great to use that starting from 7.3 I guess.
I'm not sure how to fix the failing serializer test. For me it looks like that it's an invalid test, because it defines |
I cannot upgrade to 7.3 because I get: