-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add PHPStan bleeding edge compatibility #98
Conversation
Sounds like greek to me. |
Yeah the AST processing code is wild |
I think I know why the parsing on PHP < 7.4 isn't working, I'll take a look tomorrow. |
No 1.6 :( https://github.com/phpstan/phpstan/blob/1.6.1/composer.json#L6 |
For the PHP error in PHPCS on PHP 8.1: WordPress/WordPress-Coding-Standards#2035 (comment) 👀 |
Still fails on PHP 7.2 --- Expected
+++ Actual
@@ @@
-'string'
+'PHPUnit\Framework\MockObject\Stub\ReturnStub' |
I started debugging this, not sure yet why it only happens on 7.2 but the
I can open a PR against your branch John, if you like. or anyone of you feel free and go ahead and just adapt it, if that's faster :) UPDATE: opened #101, feel free to merge that or use parts from it here, whatever you prefer. |
sorry for the PR noise, @johnbillion checkout https://github.com/johnbillion/phpstan-wordpress/pull/1 if you have time. that should fix it |
@johnbillion Is it my turn now? |
Sure 🍸 |
It looks like the hook docblock detection broke in PHPStan bleeding edge in 1.6 due to removal of the
parent
attribute: https://phpstan.org/blog/preprocessing-ast-for-custom-rules .The
getNullableNodeComment()
method needs to be updated so it doesn't use theparent
node attribute.