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
Allow returning null from a PHPDoc void union #10291
Comments
Maybe thats something we can error about in bleeding edge, but no longer error for non-bleeding-edge? Or maybe move the whole void-to-null transformation behind bleeding edge entirely |
Thanks @herndlm ! I've updated the example a little and added a second related code sample too (though that doesn't seem to error in the sandbox): |
This fixes the new issue introduced in the latest release: phpstan/phpstan-src@40c8fb2 I'm not sure what to do about Also - I added WP CS into integration tests here so we're gonna now in the future when we'd break it with our changes :) |
@ondrejmirtes Thank you for the swift action!
I wouldn't worry about that one, we made a choice to ignore that (for the previously mentioned stability reasons) before.
That's great to hear. In the future, I'm looking to see if I can raise the level for PHPCS itself too (currently at level 0). That will likely result in more reports 😉 |
Added PHPCS too :) c615993 |
@ondrejmirtes I don't quite understand the change yet, but it seems that this is now causing problems in Larastan's unit tests. For example https://github.com/larastan/larastan/actions/runs/7197697590/job/19605436384?pr=1792 (larastan/larastan#1792). |
I'd say these results are better and more precise and the test expectations need to be adjusted on Larastan's master. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
See phpstan/phpstan-src#2778 (comment) or WordPress/WordPress-Coding-Standards#2416 / https://github.com/WordPress/WordPress-Coding-Standards/blob/5f0c8a7ebdde0314ea5e30f76375a10c7d6f3910/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php
just to minimize the risk I forget..
fyi @jrfnl (also a big phpcs fan here 😊, thx for your work!)
Code snippet that reproduces the problem
https://phpstan.org/r/12a90bd8-64db-4620-855c-23579d0085f6
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: