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

WIP: Move several extensions to WP stubs #235

Merged
merged 30 commits into from
Oct 9, 2024

Conversation

IanDelMar
Copy link
Contributor

@IanDelMar IanDelMar commented Aug 23, 2024

Description

This pull request syncs the 2.x branch with the master branch and removes extensions whose functionality has already been implemented or is about to be implemented by php-stubs/wordpress-stubs, or is no longer needed or is incorrect:

  • EchoKeyDynamicFunctionReturnTypeExtension
  • GetApprovedCommentsDynamicFunctionReturnTypeExtension
  • GetListTableDynamicFunctionReturnTypeExtension
  • GetPostDynamicFunctionReturnTypeExtension
  • GetPostsDynamicFunctionReturnTypeExtension
  • GetSitesDynamicFunctionReturnTypeExtension
  • GetTermsDynamicFunctionReturnTypeExtension
  • WpDieDynamicFunctionReturnTypeExtension
  • WpThemeMagicPropertiesClassReflectionExtension

EchoKeyDynamicFunctionReturnTypeExtension

  • Only the_title_attribute(), wp_dropdown_languages(), wp_get_archives(), wp_list_bookmarks(), wp_list_categories(), and wp_list_pages() have been transferred to php-stubs/wordpress-stubs.
  • wp_dropdown_categories(), wp_dropdown_pages(), wp_dropdown_users(), and wp_link_pages() always return a string as documented, and hence are not included in any PR porting functionality to php-stubs/wordpress-stubs.
  • The $args parameter of get_search_form(), wp_list_authors(), wp_list_comments(), wp_list_users(), wp_login_form(), and wp_page_menu() is filterable, and thus the value of $args['echo'] is unknown. Therefore, these were excluded from the functionality ported to php-stubs/wordpress-stubs.

RedirectCanonicalDynamicFunctionReturnTypeExtension

Starting from PHPStan 1.10.49, void types, including void in unions, are transformed into null. This extension is no longer needed.

Related

PRs implementing the functionality in php-stubs/wordpress-stubs

To Do

  • Check if EchoKeyDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if GetListTableDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if GetPostDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if RedirectCanonicalDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if ShortcodeAttsDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if StringOrArrayDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if WpDieDynamicFunctionReturnTypeExtension can be implemented in WP stubs
  • Check if WpThemeMagicPropertiesClassReflectionExtension can be implemented in WP stubs
  • Update the php-stubs/wordpress-stubs version in composer.json to the first released version that includes all the functionality of the removed extensions

@szepeviktor
Copy link
Owner

All right.
Please help me review it.

@IanDelMar
Copy link
Contributor Author

All right. Please help me review it.

Although it may not seem like it, there isn't actually much to review. This PR removes some of the extensions that have been ported to WP stubs. The remainder is simply an import of recent changes (from the last two months) in the master branch.

@IanDelMar IanDelMar marked this pull request as ready for review September 8, 2024 19:27
@IanDelMar IanDelMar mentioned this pull request Oct 9, 2024
@szepeviktor szepeviktor merged commit 2bd4b7d into szepeviktor:2.x Oct 9, 2024
0 of 2 checks passed
@IanDelMar IanDelMar deleted the move-to-stubs branch October 9, 2024 22:47
@IanDelMar IanDelMar mentioned this pull request Nov 11, 2024
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.

2 participants