-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
[Scoper] Add CommunityNodeVisitorAbstract to be used for community that include getRuleDefinition() empty method #6476
Conversation
…at include getRuleDefinition() empty method
Do I understand correctly that I can just remove the whole |
Ah no, I just removed it and then it complains about it. |
@ruudk this is for safe belt, the replace to use |
Got it, makes sense! |
All checks have passed 🎉 @TomasVotruba I think it is ready. |
This is intentional, |
This PR is wrong, as it would only silence the removal. The method |
If I remove
|
@ruudk that seems due to overlapped with real dependency of symplify/rule-doc-generator, I guess remove Could you create simple reproducible repo for that that show the error? |
It's because I use symplify/coding-standard 12.2.3 How to deal with that now? |
@ruudk remove |
That is not a solution, as now PHPStan complains that I should add
|
So the problem is, that PHPStan sees different code than what Rector sees. So if I fix it for Rector, it breaks for PHPStan. And visa versa. |
I think register to phpstan ignoreErrors is the way for that |
Sorry, but this is wrong. Ignoring that error in PHPStan is not a solution. Why does PHPStan see it that way? |
Shouldn't we remove DocumentedRuleInterface from https://github.com/rectorphp/rector-src/blob/main/src/Contract/Rector/RectorInterface.php ? |
because PHPStan sees autoload from I will create new PR to remove -interface RectorInterface extends NodeVisitor, DocumentedRuleInterface
+interface RectorInterface extends NodeVisitor so it won't error. |
That seems like it! 😁 |
Thank you for pushing this one for a better solution than my first one 👏 |
@TomasVotruba this is what I mean.
On rector-src code base, the
AbstractRector
still enforce to havegetRuleDefinition()
method, but not for community, but still have empty method for it.This PR add
CommunityNodeVisitorAbstract
to be extended fromAbstractRector
on scoping process, to avoid issue like what @ruudk have at rectorphp/rector#8815 (comment)