-
-
Notifications
You must be signed in to change notification settings - Fork 25
WordPress 7.1 stubs #476
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
Merged
Merged
WordPress 7.1 stubs #476
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
ec6f6b5
generate stubs for WordPress 7.1
IanDelMar f737ed7
WP_Filesystem: remove obsolete function map entries
IanDelMar 73ffe7c
don't generate a `@phpstan-param` tag when the docblock already has one
IanDelMar e12b9cb
sanitize_post: remove obsolete function map entry
IanDelMar c112a21
block_core_...: remove obsolete function map entries
IanDelMar 12cb421
fix incompatible return type in final-tag test data
IanDelMar 4ebe1f1
don't infer void or never when the docblock already has a return type
IanDelMar 4d51c3c
wpdb: remove obsolete function map entries
IanDelMar e05d18e
get_approved_comments: remove obsolete function map entry
IanDelMar bdb2c17
get_comment: remove obsolete function map entry
IanDelMar 1544f11
stripslashes_deep: remove obsolete function map entry
IanDelMar 03ed63e
restore legacy data for monitoring WP core types
IanDelMar ff84b56
_get_cron_array: remove obsolete function map entry
IanDelMar e3015d0
wp_slash: remove obsolete return type function map entry
IanDelMar 84b0470
wp_unslash: remove obsolete function map entry
IanDelMar 54efadc
wp_parse_list: remove obsolete function map entry
IanDelMar 47d7a9f
Update wp-is-numeric-array.php
IanDelMar 4aa46d4
add monitoring data to PHPStan exclusions
IanDelMar 61fd26d
Update phpcs.xml.dist
IanDelMar 0d75e5d
visitor: fix types for generic PHPStan tags
IanDelMar c55d8d1
Update term-exists.php
IanDelMar 9e626fb
Revert "Update term-exists.php"
IanDelMar 0aec055
check_admin_referer: add conditional return type
IanDelMar 6a0cf5d
check_ajax_referer: add conditional return type
IanDelMar 47c158e
get_post_ancestors: remove obsolete function map entry
IanDelMar 6e51a8f
get_post: remove obsolete param type function map entry
IanDelMar d272222
wp_get_speculation_rules_configuration: remove obsolete function map …
IanDelMar fddd35e
block_core_navigation_render_submenu_icon: remove obsolete function m…
IanDelMar c2b4e1a
edit_term_link: update return type
IanDelMar 38e4cdc
wp_unique_id & wp_unique_prefixed_id: narrow return type
IanDelMar ccca9c4
wp_is_numeric_array: remove obsolete assert fn map entry
IanDelMar 94713bb
WP_Widget_Factory::$widgets: update property type
IanDelMar 44836e8
WP_Widget_Factory::[un]register: add param test
IanDelMar 7f2bf33
get_page_by_path: remove obsolete function map entry
IanDelMar e9af817
get_post: remove obsolete function map entry
IanDelMar 5abda53
wp_get_elements_class_name: narrow return type
IanDelMar 479cfa1
use `...` for unsealed arrays
IanDelMar ed9d9f8
use `...` for unsealed arrays
IanDelMar e170e07
bump PHPStan to ^2.2
IanDelMar a9ad3aa
Update Visitor.php
IanDelMar f2ef05c
wp_upload_dir: fix return type
IanDelMar 87f8df8
Merge remote-tracking branch 'upstream/master' into wp71
IanDelMar c584af8
Merge remote-tracking branch 'upstream/master' into wp71
IanDelMar 673e7c9
wp_upload_dir: widen return type
IanDelMar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace PhpStubs\WordPress\Core\Tests; | ||
|
|
||
| // Incorrect - not a WP_Widget subclass(-string) | ||
| Faker::wpWidgetFactory()->register(Faker::wpPost()); | ||
| Faker::wpWidgetFactory()->register(Faker::classString(Faker::wpPost())); | ||
| Faker::wpWidgetFactory()->register('NoClassString'); | ||
| Faker::wpWidgetFactory()->unregister(Faker::wpPost()); | ||
| Faker::wpWidgetFactory()->unregister(Faker::classString(Faker::wpPost())); | ||
| Faker::wpWidgetFactory()->unregister('NoClassString'); | ||
|
|
||
| // Correct | ||
| Faker::wpWidgetFactory()->register(Faker::wpWidget()); | ||
| Faker::wpWidgetFactory()->register(Faker::classString(Faker::wpWidget())); | ||
| Faker::wpWidgetFactory()->unregister(Faker::wpWidget()); | ||
| Faker::wpWidgetFactory()->unregister(Faker::classString(Faker::wpWidget())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace PhpStubs\WordPress\Core\Tests; | ||
|
|
||
| use function check_admin_referer; | ||
| use function PHPStan\Testing\assertType; | ||
|
|
||
| assertType('1|2|false', check_admin_referer(-1, Faker::string())); | ||
| assertType('1|2', check_admin_referer(Faker::string(), Faker::string())); | ||
| assertType('1|2|false', check_admin_referer(Faker::int(), Faker::string())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace PhpStubs\WordPress\Core\Tests; | ||
|
|
||
| use function check_ajax_referer; | ||
| use function PHPStan\Testing\assertType; | ||
|
|
||
| $action = Faker::union(Faker::string(), Faker::int()); | ||
| $queryArg = Faker::union(Faker::string(), Faker::bool()); | ||
|
|
||
| assertType('1|2', check_ajax_referer($action, $queryArg)); | ||
| assertType('1|2', check_ajax_referer($action, $queryArg, true)); | ||
| assertType('1|2|false', check_ajax_referer($action, $queryArg, false)); | ||
| assertType('1|2|false', check_ajax_referer($action, $queryArg, Faker::bool())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnbillion Does this make your wish come true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szepeviktor this has been added in #467