Skip to content

Add dynamic return type extension for wp_tag_cloud()#147

Closed
IanDelMar wants to merge 4 commits intoszepeviktor:masterfrom
IanDelMar:wp-tag-cloud
Closed

Add dynamic return type extension for wp_tag_cloud()#147
IanDelMar wants to merge 4 commits intoszepeviktor:masterfrom
IanDelMar:wp-tag-cloud

Conversation

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

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

@herndlm
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread src/WpTagCloudDynamicFunctionReturnTypeExtension.php Outdated
Comment thread src/WpTagCloudDynamicFunctionReturnTypeExtension.php Outdated
@IanDelMar IanDelMar marked this pull request as ready for review November 2, 2023 22:54
@IanDelMar
Copy link
Copy Markdown
Contributor Author

Implemented in stubs #147

@IanDelMar IanDelMar closed this Aug 27, 2024
@IanDelMar IanDelMar deleted the wp-tag-cloud branch August 27, 2024 21:08
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.

3 participants