-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Fix missing stmt on adding a new node #6383
Conversation
f3592ae
to
d0f6a2d
Compare
reset($all); | ||
if (($inputArgument = isset($all[$key = key($all)]) ? $all[$key = key($all)] : null) && 'command' === $inputArgument->getName()) { | ||
} | ||
} |
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.
@samsonasik BTW, today I find one nasty bug in Rector.
This might be one reason why the downgrade rules were not working sometimes.
This code previously failed and missed all the removed types. Causing missmatch:
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.
@TomasVotruba thank you 👍
$currentStmt = $node->getAttribute(AttributeKey::CURRENT_STATEMENT); | ||
if ($currentStmt instanceof Stmt) { | ||
return spl_object_hash($currentStmt); | ||
} | ||
|
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 is the fix that helped. It might require more parent node/stmt connecting fixes though
if ($foundNode === null) { | ||
$foundNode = $node; |
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.
Not sure why I put this here (probably not knowing difference between Stmt and Expr in that time), but it was asking for a bug 🤔
If it's null
, it has to fail
rectorphp/rector-src@7be438b [DeadCode] Skip non FullyQualified property type on RemoveTypedPropertyNonMockDocblockRector (#6383)
No description provided.