phpstan-wordpress
phpstan-wordpress copied to clipboard
WIP: Move several extensions to WP stubs
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:
EchoKeyDynamicFunctionReturnTypeExtensionGetApprovedCommentsDynamicFunctionReturnTypeExtensionGetListTableDynamicFunctionReturnTypeExtensionGetPostDynamicFunctionReturnTypeExtensionGetPostsDynamicFunctionReturnTypeExtensionGetSitesDynamicFunctionReturnTypeExtensionGetTermsDynamicFunctionReturnTypeExtensionWpDieDynamicFunctionReturnTypeExtension
EchoKeyDynamicFunctionReturnTypeExtension
- Only
the_title_attribute(),wp_dropdown_languages(),wp_get_archives(),wp_list_bookmarks(),wp_list_categories(), andwp_list_pages()have been transferred to php-stubs/wordpress-stubs. wp_dropdown_categories(),wp_dropdown_pages(),wp_dropdown_users(), andwp_link_pages()always return a string as documented, and hence are not included in any PR porting functionality to php-stubs/wordpress-stubs.- The
$argsparameter ofget_search_form(),wp_list_authors(),wp_list_comments(),wp_list_users(),wp_login_form(), andwp_page_menu()is filterable, and thus the value of$args['echo']is unknown. TTherefore, 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
- https://github.com/php-stubs/wordpress-stubs/pull/127
- https://github.com/php-stubs/wordpress-stubs/pull/195
- https://github.com/php-stubs/wordpress-stubs/pull/197
- https://github.com/php-stubs/wordpress-stubs/pull/198
- https://github.com/php-stubs/wordpress-stubs/pull/199
- https://github.com/php-stubs/wordpress-stubs/pull/200
- https://github.com/php-stubs/wordpress-stubs/pull/201
- https://github.com/php-stubs/wordpress-stubs/pull/202
- https://github.com/php-stubs/wordpress-stubs/pull/209
To Do
- [x] Check if
EchoKeyDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [x] Check if
GetListTableDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [x] Check if
GetPostDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [x] Check if
RedirectCanonicalDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [x] Check if
ShortcodeAttsDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [x] Check if
StringOrArrayDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [x] Check if
WpDieDynamicFunctionReturnTypeExtensioncan be implemented in WP stubs - [ ] Update the
php-stubs/wordpress-stubsversion incomposer.jsonto the first released version that includes all the functionality of the removed extensions
All right. Please help me review it.
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.