fix(RemoveParentCallWithoutParentRector): skip cases when class reflection is not found#7723
fix(RemoveParentCallWithoutParentRector): skip cases when class reflection is not found#7723calebdw wants to merge 1 commit intorectorphp:mainfrom
Conversation
|
Could you add fixture file for it? Thank you. |
|
I tried, but I couldn't replicate in the fixture. It has to do with the reflection provider not being able to find the class |
|
That's strange as class is a node the rule visited, that the ClassReflection exists. I assume you have duplicated class name so phpstan can't locate which one which. |
|
I think it's because I run rector on our tests, but I exclude the tests from phpstan because I don't care about all the warnings. This is the first time I've had any issues |
|
in that case, I guess you can add autoloadPaths it via withAutoloadPaths https://getrector.com/documentation/static-reflection-and-autoload |
|
Hmm, doesn't look like that worked |
|
rector config can set its own phpstan, see example |
|
Hmm, looks like I needed to split |
Hello!
This rule is removing the
parent::__construct()calls when it shouldn't. After some digging I found that the following returns true when the class reflection can't be found, instead of assuming that it has no parents we should just skip:Thanks!