Docs: Add the missing $has_custom_overlay param to the Navigation block DocBlock#12640
Conversation
…lock DocBlock. `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 `@param` entry. This adds the missing tag in signature order, per the WordPress PHP documentation standards. Fixes #65691.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
Updates inline PHPDoc for the Navigation block renderer to properly document the full WP_Navigation_Block_Renderer::get_overlay_inline_styles() method signature (introduced in WP 7.0.0), aligning the documentation with WordPress PHPDoc standards and the adjacent/sibling method’s parameter meaning.
Changes:
- Adds the missing
@param bool $has_custom_overlaytag toget_overlay_inline_styles(). - Orders the
@paramtags to match the function signature and aligns columns per WP doc standards.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
westonruter
left a comment
There was a problem hiding this comment.
The tests are failing because this file is managed in the Gutenberg repo. You'll need to make the fix there:
| * | ||
| * @param array $colors The colors array. | ||
| * @param bool $has_custom_overlay Whether a custom overlay is used. | ||
| * @param array $colors The colors array. |
There was a problem hiding this comment.
Since we're touching the docblock here, we should take the opportunity to provide the full PHPStan typing for this param. So this could be done by adding another tag at the bottom of the docblock:
* @phpstan-param array{
* overlay_inline_styles: string,
* } $colors
|
Thanks for the review @westonruter, and for pointing out that this file is managed in the Gutenberg repo. I've moved the fix there: WordPress/gutenberg#80622 Both pieces of feedback are addressed in that PR:
I also applied the same treatment to the sibling Shall I close this PR in favour of the Gutenberg one, or leave it open until the change syncs back to Core? |
|
Yes, this should be closed now. |
Trac ticket
https://core.trac.wordpress.org/ticket/65691
Description
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
@param bool $has_custom_overlaytag in signature order, with columns aligned per the WordPress PHP documentation standards. The description matches the sibling methodget_responsive_container_classes(), which documents the same parameter.Documentation-only change; no behavior is affected.