-
-
Notifications
You must be signed in to change notification settings - Fork 19
Ignore inaccessible class child nodes #15
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
Ignore inaccessible class child nodes #15
Conversation
I think this could be resolved in PHPStan. BTW PHPStan is written in PHP so it is not expected to be as fast as C code. The current maintenance effort is over my personal max. |
the performance problems should be fixed in phpstan for sure. this PR was meant to just clean up the stubs a bit further which is not really related and makes sense anyways IMO. it could also be made configurable with a "include_inaccessible_class_nodes" config (a couple of lines more I already prepared). but it's also fine to keep it as it is of course, this is your stubs generator :) but maybe you also want to remove the "PR welcome" message from the README then. |
Martin! We were forced to fork this project as we had problems. Stubs could be modified here: https://github.com/php-stubs/wordpress-stubs/blob/master/visitor.php#L37 I'll merge this as soon as any other person is complaining about private methods. Okay? |
|
To be honest I do not know what will happen by this PR. |
Actually this generator is a highly unstable project. You must be brave enough to touch daily work of thousands. |
@herndlm Have you seen the actual diff?
|
I briefly scrolled through it, yeah. Was looking fine to me. But please let's not argue over this, if it's too risky then it shall not be touched and over :) or, as you suggested, work can be continued if more people want/need this. |
I would be in favour of removing these inaccessible nodes by default. Perhaps with a config flag to not exclude them in cases where they are needed? |
If it breaks anybody's code then they can ask Viktor for a refund. |
Let's do this. |
e122630
to
0d6feee
Compare
rebased on master and added the config change I had apparently lying around since May :D |
Thank you! |
0d6feee
to
df76371
Compare
I realized that what I pushed was not ready yet, now it is, including the help adaption. |
but let me add a test case for that, sorry :) |
Thank you. |
Nice one |
Based on the idea that was voiced in szepeviktor/phpstan-wordpress#99 (comment)
It should be safe to not include private constants/properties/methods of classes. And if the class is final, protected ones can be ignored too IMO.
Fyi this only makes the wordpress-stubs around 0.1M smaller, so it won't change much in regard to parsing performance there.
What do you think?