Closed IanDelMar closed 2 months ago
I am not able to say yes or no. Help!!
@johnbillion @herndlm what do you think?
If anyone says yes I will press the merge button.
What nukes my brain: why complicate things?? why not all this is in the core?
I'm abstaining, this fries my brain too. and I'm not that well accustomed with wordpress actions and filters
I'll take a look
I don't think this has much to do with the code quality of WordPress. It's working around an issue with the detection of void and null types in PHPStan.
@IanDelMar This change looks good and the PHPUnit tests are passing but there are some failing PHPStan sniffs. Will you take a look?
Why use space-age static analysis on PHP4-smelling WordPress?
You were the one who created this library 🤣
I know how to upset Viktor.
[ERROR] Found 4 errors
After fixing these I will merge it. Thank you John!
@johnbillion Thank you for having a look!
[ERROR] Found 4 errors
After fixing these I will merge it. Thank you John!
3 of these were not introduced by this PR but are related to https://phpstan.org/blog/using-rule-error-builder#error-identifiers. They should be handled in a separate PR. Also, ultimately it's not up to me how this project names the errors.
Thank you.
221 was caused by the
VoidType
acceptingNullType
from PHPStan version 1.10.50 onwards (see this commit).This PR fixes #221 by using
isVoid()
to check forVoidType
.isVoid()
does not acceptNullType
.Additionally, this PR adds a test for action callbacks that return
null
. Before this fix, the additional test was failing as well for the same reason.Related: #222