Navigation: Complete the DocBlocks for the responsive container and overlay style helpers - #80622
Merged
shail-mehta merged 4 commits intoAug 6, 2026
Conversation
…verlay style helpers WP_Navigation_Block_Renderer::get_overlay_inline_styles() documented only its second parameter, $colors. Add the missing @PARAM entry for the first parameter, $has_custom_overlay, in signature order. Align the @PARAM columns in both get_overlay_inline_styles() and the sibling get_responsive_container_classes() per the WordPress PHP documentation standards, and add @phpstan-param array shapes describing the $colors keys each method reads. Documentation only; no behavior is affected.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
westonruter
reviewed
Jul 23, 2026
block_core_navigation_build_css_colors() returns four keys, so the @phpstan-param shapes must not imply the arrays are sealed to the single key each method reads.
Contributor
There was a problem hiding this comment.
Pull request overview
Completes and improves PHPDoc/PHPStan documentation for Navigation responsive overlay helpers without runtime changes.
Changes:
- Documents the missing
$has_custom_overlayparameter. - Aligns parameter descriptions and adds precise
$colorsarray shapes.
talldan
pushed a commit
that referenced
this pull request
Aug 6, 2026
…verlay style helpers (#80622) * Navigation: Complete the DocBlocks for the responsive container and overlay style helpers WP_Navigation_Block_Renderer::get_overlay_inline_styles() documented only its second parameter, $colors. Add the missing @PARAM entry for the first parameter, $has_custom_overlay, in signature order. Align the @PARAM columns in both get_overlay_inline_styles() and the sibling get_responsive_container_classes() per the WordPress PHP documentation standards, and add @phpstan-param array shapes describing the $colors keys each method reads. Documentation only; no behavior is affected. * Navigation: Mark the $colors array shapes as unsealed. block_core_navigation_build_css_colors() returns four keys, so the @phpstan-param shapes must not imply the arrays are sealed to the single key each method reads. --------- Co-authored-by: itzmekhokan <khokansardar@git.wordpress.org> Co-authored-by: shail-mehta <shailu25@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org>
amitraj2203
pushed a commit
that referenced
this pull request
Aug 10, 2026
…verlay style helpers (#80622) * Navigation: Complete the DocBlocks for the responsive container and overlay style helpers WP_Navigation_Block_Renderer::get_overlay_inline_styles() documented only its second parameter, $colors. Add the missing @PARAM entry for the first parameter, $has_custom_overlay, in signature order. Align the @PARAM columns in both get_overlay_inline_styles() and the sibling get_responsive_container_classes() per the WordPress PHP documentation standards, and add @phpstan-param array shapes describing the $colors keys each method reads. Documentation only; no behavior is affected. * Navigation: Mark the $colors array shapes as unsealed. block_core_navigation_build_css_colors() returns four keys, so the @phpstan-param shapes must not imply the arrays are sealed to the single key each method reads. --------- Co-authored-by: itzmekhokan <khokansardar@git.wordpress.org> Co-authored-by: shail-mehta <shailu25@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org>
shail-mehta
pushed a commit
that referenced
this pull request
Aug 12, 2026
…verlay style helpers (#80622) * Navigation: Complete the DocBlocks for the responsive container and overlay style helpers WP_Navigation_Block_Renderer::get_overlay_inline_styles() documented only its second parameter, $colors. Add the missing @PARAM entry for the first parameter, $has_custom_overlay, in signature order. Align the @PARAM columns in both get_overlay_inline_styles() and the sibling get_responsive_container_classes() per the WordPress PHP documentation standards, and add @phpstan-param array shapes describing the $colors keys each method reads. Documentation only; no behavior is affected. * Navigation: Mark the $colors array shapes as unsealed. block_core_navigation_build_css_colors() returns four keys, so the @phpstan-param shapes must not imply the arrays are sealed to the single key each method reads. --------- Co-authored-by: itzmekhokan <khokansardar@git.wordpress.org> Co-authored-by: shail-mehta <shailu25@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org>
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 https://core.trac.wordpress.org/ticket/65691
Follow up to WordPress/wordpress-develop#12640
WP_Navigation_Block_Renderer::get_overlay_inline_styles(), introduced in WordPress 7.0.0, documented only its second parameter,$colors. Its first parameter,$has_custom_overlay, had no@paramentry.This adds the missing tag, aligns the
@paramcolumns in that method and in its siblingget_responsive_container_classes(), and adds@phpstan-paramarray shapes for the$colorskeys each method reads.Why?
The fix was originally proposed against Core in WordPress/wordpress-develop#12640, where @westonruter pointed out that this file is managed in the Gutenberg repo and the change needs to be made here first:
He also suggested taking the opportunity to provide the full PHPStan typing for
$colorswhile the DocBlock is being touched.An undocumented parameter is a documentation standards violation, and the missing entry is easy to miss because the remaining
@param array $colorsline makes the block look complete at a glance.How?
@param bool $has_custom_overlaytoget_overlay_inline_styles(), in signature order.@paramdescription columns in both methods per the WordPress PHP documentation standards.get_responsive_container_classes()had the same misalignment, so it is corrected here rather than left for a follow up.@phpstan-paramarray shapes documenting only the keys each method actually reads:get_overlay_inline_styles()readsoverlay_inline_styles(astring).get_responsive_container_classes()readsoverlay_css_classes(alist<string>, passed toimplode()).Both keys are produced by
block_core_navigation_build_css_colors(), which returnscss_classes,inline_styles,overlay_css_classesandoverlay_inline_styles. The shapes follow the existing convention inlib/block-supports/custom-css.phpandlib/block-supports/elements.php, placing the tag after@return.Documentation only; no behavior is affected.
Testing Instructions
This is a documentation-only change, so there is nothing to exercise in the editor. To verify:
composer lint -- packages/block-library/src/navigation/index.phpand confirm it passes.packages/block-library/src/navigation/index.phpand confirm the DocBlocks forget_responsive_container_classes()andget_overlay_inline_styles()list every parameter in signature order with aligned columns.To confirm no runtime change, compare the PHP token stream against
trunkwith comments and whitespace stripped; it is byte-identical (5949 tokens, matching checksum).Testing Instructions for Keyboard
N/A. No user interface changes.
Screenshots or screencast
N/A. No user interface changes.
Use of AI Tools
This pull request was prepared with the assistance of Claude Code. The AI was used to locate the affected DocBlocks, apply the changes, and run verification (PHPCS with the repository ruleset,
php -l, PHPStan checks of the array shapes, and a token stream comparison againsttrunk). I reviewed the resulting diff and the verification output, and I take responsibility for the contents of this pull request.