szepeviktor / phpstan-wordpress

WordPress extensions for PHPStan ⛏️
https://packagist.org/packages/szepeviktor/phpstan-wordpress
MIT License
262 stars 26 forks source link

Allow returning null from a callback #224

Closed the-csaba closed 2 months ago

the-csaba commented 2 months ago

Fixes #221

Attempt to distinguish between returning void and null from a callback.

Unfortunately, some filters are expecting a null value. See an example in the WooCommerce repository here:

https://github.com/woocommerce/woocommerce/blob/7f657cca539af928a58b05716423971b737da91f/plugins/woocommerce/includes/admin/class-wc-admin-settings.php#L934-L938

the-csaba commented 2 months ago

Hi @szepeviktor ,

I missed that #223 already exists. Feel free to close this.

szepeviktor commented 2 months ago

Thank you, Csaba.