-
Notifications
You must be signed in to change notification settings - Fork 63
Fix argument.type PHPStan errors #553
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
Conversation
| - | ||
| identifier: argument.type |
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.
since argument types were ignored, the root cause for #552 was not detected.
|
|
||
| // must respect PHPStan anonymous internal naming \Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver::ANONYMOUS_CLASS_START_REGEX | ||
| return new Class_('AnonymousClass1234', [ | ||
| // @phpstan-ignore argument.type |
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.
We don't use inline ignores by convention. Better use assert or fix this one
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.
to be hones, I did not understand what the error is about at this line
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.
send a try and error fix
| if (! $expr->value instanceof Array_) { | ||
| return null; | ||
| } | ||
|
|
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.
👍
| return null; | ||
| } | ||
|
|
||
| $matchedNullableVariableNameToType = $variableNameToTypeCollection->matchByVariableName($variableName); |
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.
👍
|
@staabm please run: thank you. |
| throw new NotImplementedYetException(); | ||
| } | ||
|
|
||
| if (! $className instanceof Name) { |
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.
probably need test for $firstArg->value is a String_, not Foo::class, but "Foo", so if it is a String_, use its value, also possibly verify by value via ValueResolver, but that can be later 👍
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.
yeah, please do this for me.
I did not plan to deep dive into this codebase :)
|
Ready to land |
|
Thank you @staabm |
No description provided.