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
[DeadCode][TypeDeclaration] Handle Nullable Param on RemoveUnusedPrivateMethodParameterRector+RemoveUnreachableStatementRector+AddArrayParamDocTypeRector #1216
Conversation
…Rector+RemoveUnreachableStatementRector+AddArrayParamDocTypeRector
Fixed 🎉 |
All checks have passed 🎉 @TomasVotruba it is ready for review. |
if ($type instanceof ObjectType && ! $type instanceof FullyQualifiedObjectType) { | ||
return new MixedType(); | ||
} |
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 would falsy transform all short object types to mixed. That's incorrect.
Instead we should find out, why the short class name is resolved. It will affect more rules.
IMO it will be related somehow to NameResolver.
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.
Fixed with namespacedName
attribute in a Name
node check 9e49b53 🎉
oh, that's seems broke |
This looks better! 👍 It broke the typo3 package probalby, not sure why. Could you check it? |
I will try. |
Fixed 🎉 by move the namespacedName check under |
650f605
to
9304060
Compare
650f605
to
f0c47c0
Compare
All checks have passed 🎉 @TomasVotruba I think it is ready. |
Thank you |
Given the following code:
It produce addition docblock:
while removing unused parameter in private method. The Param itself is invalid as there is no
\ClassLike
class, butPhpParser\Node\Stmt\ClassLike
which imported in use statement.Applied rules: