-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix static analysis regressions introduced during the 7.1 cycle #13064
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
Closed
westonruter
wants to merge
17
commits into
WordPress:trunk
from
westonruter:fix/phpstan-7.1-regressions
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d875967
Restore string|void on WP_Widget::form()
westonruter 97f1544
Call WP_Theme_JSON's private static methods through self
westonruter 5c6a81b
Document get_feature_declarations_for_node()'s params as arrays
westonruter b7a00c1
Drop a redundant empty check in merge_properties()
westonruter 60664f9
Drop isset() checks on properties that are always set
westonruter cf9a4af
Declare the $wpdb global on the Users screen
westonruter b24d67b
Stop baselining a substr_compare() report PHPStan gets wrong
westonruter cbcdd48
Document comment_shortcuts and infinite_scrolling on WP_User
westonruter 5df0317
Include the array returns in WP_Block_Type::__get()'s type
westonruter 84c63c3
Correct term_exists()'s conditional return for the no-taxonomy case
westonruter 77dc415
Allow an integer for WP_Comment's two ID properties
westonruter 8bcbefb
Merge origin/trunk into fix/phpstan-7.1-regressions
westonruter 0c67fda
Merge origin/trunk into fix/phpstan-7.1-regressions
westonruter ebb4ee7
Merge origin/trunk into fix/phpstan-7.1-regressions
westonruter 4c54ae2
Merge branch 'trunk' into fix/phpstan-7.1-regressions
westonruter cf61d68
Merge branch 'trunk' into fix/phpstan-7.1-regressions
westonruter 0a2a77c
Re-generate baselines after clearing PHPStan cache
westonruter 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
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
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.
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.
Why remove that? I don't see how this is not a different behavior.
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.
The
&& array() !== $currentcondition is flagged as a PHPStan error:Thinking this through: If
$currentis anarraybut it is not a list, then is it guaranteed to never be an empty array as PHPStan has identified?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.
Because if it is not a list, then it must have a non-sequential key, and this implies that the array is not empty?
Also per Claude Opus 5:
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.
yeah agreed, can follow you on that now. was not fully aware of
array_is_list()