szepeviktor / phpstan-wordpress

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

Add dynamic return type extension for `wp_tag_cloud()` #147

Closed IanDelMar closed 2 months ago

IanDelMar commented 1 year ago

This PR adds a dynamic function return type extension for wp_tag_cloud().

I have made several updates to the extension since the initial draft:

IanDelMar commented 1 year ago

I'll have a look at the failed checks tomorrow.

herndlm commented 1 year ago

Jfyi I think we need to be careful to not introduce too many instanceof checks, see also https://phpstan.org/blog/why-is-instanceof-type-wrong-and-getting-deprecated :)

But don't let this block you here, maybe for the next PR. We can try to refactor some away later

IanDelMar commented 1 year ago

@herndlm Thank you! I wasn't aware of that.

IanDelMar commented 2 months ago

Implemented in stubs https://github.com/szepeviktor/phpstan-wordpress/pull/147