[PostRector] Skip re-import name on callable name node#5022
[PostRector] Skip re-import name on callable name node#5022TomasVotruba merged 19 commits intomasterfrom
Conversation
|
This will need a failing test case first, so we're sure it's fixed |
|
yes, it works functional |
|
we may need to replicate |
82a50cb to
fe6fcee
Compare
|
still have 1 error: |
|
finally fixed 🎉 |
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
| return static function (ContainerConfigurator $containerConfigurator): void { | ||
| $parameters = $containerConfigurator->parameters(); | ||
|
|
||
| $parameters->set(Option::SETS, [SetList::DEAD_CODE]); | ||
| $parameters->set(Option::AUTO_IMPORT_NAMES, true); | ||
| }; |
|
Still getting the error from #3383 unfortunately. I'll try to debug it now i can see your fix. |
|
@bendavies I tried with You can use |
|
Thanks @samsonasik . Definitely doesn't work on another project of mine, using the master version of rector. |
|
Just in case it by cache, you can run with vendor/bin/rector --clear-cache process |
|
@bendavies To save both yours and ours time, a GitHub repository with failing GitHub Action would be helpful. |
|
hi @samsonasik i've replicated the bug again here: @TomasVotruba i have tried to reproduce in github actions in that repo but strangely it didn't replicate. It errors locally to me. I'll continue to try and work out why it errors locally for me. |
|
I've also added a stack trace on that repo readme |
|
well, adding if (function_exists($classLike)) {
return true;
}to fixes the issue for me. |
|
I think the problem might be here?
|
|
@bendavies I did a lot of simulation in that part :), that's used in rules, that's why that check was needed, could you provide a patch and add a fixture to https://github.com/rectorphp/rector/tree/master/tests/Issues/Issue3383/DoNotReImportFunction/Fixture for reproduce it? thank you. |
|
@bendavies I cloned your repo, re-try run That maybe related with cache somewhere, please try clear cache composer as well. |
|
@bendavies you may need to remove That's it, I can't reproduce it by using your repo. If you can provide reproduceable fixture, and provide a fix, that will be awesome ;) |
|
@samsonasik thanks for trying. i'll try to get a reproduced in this repo. |
rectorphp/rector-src@307b9d6 Add note on using pwsh on Windows with parallel mode (#5022)


Fixes #3383