Repository navigation
Duotone: Remove null from get_all_global_style_block_names return type - #86107
Closed
noruzzamans wants to merge 1 commit into
Closed
noruzzamans wants to merge 1 commit into
noruzzamans wants to merge 1 commit into
Conversation
noruzzamans
requested review from
manzoorwanijk and
spacedmonkey
as code owners
November 1, 2026 03:22
🤖 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 🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. |
Member
Author
|
Closed in favor of #86103, which includes this Duotone return type fix alongside the Theme JSON fixes. |
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
Removes
nullfrom the@returndocblock tag ofWP_Duotone_Gutenberg::get_all_global_style_block_names(), bringing it in line with its implementation and WordPress Core, and removes the resolved entry from the PHPStan baseline.Why?
WP_Duotone_Gutenberg::get_all_global_style_block_names()initializesself::$global_styles_block_namesas anarrayand always returns an array of block names keyed on the block name. It never returnsnull.PHPStan reports this as
return.unusedType(Method WP_Duotone_Gutenberg::get_all_global_style_block_names() never returns null so it can be removed from the return type). In WordPress Core,WP_Duotone::get_all_global_style_block_names()already documents@return string[]. This resolves 1 of the errors initially baselined in #66693.How?
@returntag onWP_Duotone_Gutenberg::get_all_global_style_block_names()inlib/class-wp-duotone-gutenberg.phpfromnull|array<string, string>toarray<string, string>.return.unusedTypeentry fromtools/phpstan/baseline.neon.No PHP source logic or runtime behavior is changed.
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 occurrence and draft the change. I reviewed the diff and take responsibility for it.