[CodeQuality] Handle crash on BinaryOp/Mul and variable variable: $$name on IntvalToTypeCastRector#3608
Conversation
|
Fixed 🎉 /cc @holdmann |
|
@TomasVotruba I fixed it by set fallback Scope on return $this->scopeFactory->createFromFile($filePath);93f6219 , this is the solution I can found for now. |
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
|
@samsonasik why not getting the scope from the first ancestor that has a scope? here maybe the parameter Expr or the MethodCall |
|
I tried that, not working, there is nearest scope filling handle for that, see but can't get the solution yet for this |
|
I found a better solution, I check against node just reprinted on |
|
Finally 🎉 🎉 🎉 All checks have passed 🎉 , the solution is handle by check that node is just re-printed along with parent re-print on ScopeAnalyzer. @TomasVotruba I think it is ready. |
|
@TomasVotruba I am merging it ;) |
…ame on IntvalToTypeCastRector (#3608) * [CodeQuality] Handle crash on BinaryOp/Mul on IntvalToTypeCastRector * Fixed * [ci-review] Rector Rectify * Revert [ci-review] Rector Rectify This reverts commit a18c051. * Revert Fixed This reverts commit 93f6219. * Handle with re-printed node * clean up * Final touch: comment * [ci-review] Rector Rectify * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
Fixes rectorphp/rector#7875
Ref https://getrector.com/demo/938a84a5-ae9c-474a-95f3-9c7e0f827e77