Skip to content
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 dynamic return type extension for wp_tag_cloud() #147

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

IanDelMar
Copy link
Contributor

@IanDelMar IanDelMar commented Feb 9, 2023

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:

  • It now only checks for an array parameter or an empty string.
  • The use of instanceof has been removed.
  • It requires version 5.8.4+ of wordpress-stubs.

@IanDelMar
Copy link
Contributor Author

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

@herndlm
Copy link
Contributor

herndlm commented Feb 9, 2023

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
Copy link
Contributor Author

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

@IanDelMar IanDelMar marked this pull request as draft February 10, 2023 09:58
@IanDelMar IanDelMar changed the title Add dynamic return type extension for wp_tag_cloud() Add dynamic return type extension for wp_tag_cloud() Feb 25, 2023
@IanDelMar IanDelMar marked this pull request as ready for review November 2, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants