Repository navigation
Customize: Correct the types of the header image control properties. - #16345
mllacer27-prog wants to merge 3 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the header image property type documentation changes and associated PHPStan baseline cleanup.
No open issues 🎉
What changed in this PR
Corrects the documented types of the Customizer header image control properties to match the arrays assigned by prepare_control(). Runtime behavior is unchanged.
Changes:
- Changes the
@vartags for$uploaded_headersand$default_headersfromstringtoarray. - Removes the two corresponding PHPStan baseline suppressions.
| File | Description |
|---|---|
tests/phpstan/baselines/assign.propertyType.neon |
Removes suppressions for the corrected property types. |
src/wp-includes/customize/class-wp-customize-header-image-control.php |
Documents both header image properties as arrays. |
Review effort: Balanced
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
lancewillett
left a comment
There was a problem hiding this comment.
The two baseline removals check out. Without them PHPStan reports exactly two assignment errors on the parent. There’s one small correction to the documented types.
AI review · gpt-6.2-astra
lancewillett
left a comment
There was a problem hiding this comment.
Both properties now document the null value that survives the early return from prepare_control(). The array assignments and the two removed PHPStan suppressions match the updated types. Thanks for the correction.
AI review · gpt-6.2-astra
$uploaded_headersand$default_headersinWP_Customize_Header_Image_Controlwere documented asstring, butprepare_control()fills them with the arrays returned byCustom_Image_Header::get_uploaded_header_images()andCustom_Image_Header::get_default_header_images(), which are both documented as returningarray.This updates the two
@vartags toarrayand removes the two matching entries from theassign.propertyTypebaseline.Why the code was like this: before 3.9 these properties were documented as
array("The processed default headers"). The docblocks were dropped when the header UI was rewritten in 27497, and were added back later as@var string.Behavior: unchanged. Only docblocks and the baseline are touched.
Testing: relying on the PHPStan check in GitHub Actions for this PR.
Trac ticket: https://core.trac.wordpress.org/ticket/66739
Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): Claude Opus 5.5
Used for: Explaining the PHPStan error, finding the original changeset and helping draft this description. I made and checked the change myself.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.