Repository navigation
Sync three small PHPStan fixes from Core - #86099
Merged
westonruter merged 3 commits intoNov 3, 2026
Merged
Conversation
Drop the redundant `array() !== $current` check in `Gutenberg_View_Config_Data::merge_properties()`, since `! array_is_list( $current )` already excludes an empty array, and correct the `@param` name in `WP_REST_Icon_Collections_Controller::get_items_permissions_check()`. Both already match WordPress Core. Remove the 2 resolved entries from the PHPStan baseline. See WordPress#86088.
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
`WP_Block_Type::$selectors` is always set, so only the `is_array()` check is needed. This matches `wp_render_block_states_support()` in WordPress Core. Remove the resolved entry from the PHPStan baseline. See WordPress#86088.
huzaifaalmesbah
marked this pull request as ready for review
November 1, 2026 03:38
huzaifaalmesbah
requested review from
manzoorwanijk and
spacedmonkey
as code owners
November 1, 2026 03:38
westonruter
approved these changes
Nov 3, 2026
…ix/phpstan-compat-core-sync
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What?
See #86088
Syncs three small fixes from WordPress Core into Gutenberg's WordPress 7.1 compat files and block supports, and removes the resolved entries from the PHPStan baseline.
Why?
In each case the Core counterpart is already fixed, so the Gutenberg copy was out of sync. PHPStan reports the differences as
notIdentical.alwaysTrue,parameter.notFound, andisset.property. This resolves 3 of the 226 errors initially baselined in #66693.How?
lib/compat/wordpress-7.1/class-gutenberg-view-config-data.php: removed the trailing&& array() !== $currentfrom the shape check inmerge_properties().! array_is_list( $current )is already false for an empty array, so the extra check was always true. This matchesWP_View_Config_Data::merge_properties()in Core.lib/compat/wordpress-7.1/class-wp-rest-icon-collections-controller.php: corrected@param WP_REST_Request $_requestto$requestinget_items_permissions_check(), to match the parameter name and Core's docblock.lib/block-supports/states.php: droppedisset( $block_type->selectors ), sinceWP_Block_Type::$selectorsis always set, keeping only theis_array()check. This matcheswp_render_block_states_support()in Core.tools/phpstan/baseline.neon.There is no change in behavior, and no Core backport is needed since all three changes already exist in Core.
Testing Instructions
composer phpstanand confirm it passes with no unmatched ignored errors.composer phpstan:baselinesand confirmtools/phpstan/baseline.neonhas no further changes.Testing Instructions for Keyboard
Not applicable. There are no UI changes.
Screenshots or screencast
Not applicable.
Use of AI Tools
I used Claude Code to identify the affected occurrences and draft the change. I reviewed the diff and take responsibility for it.