Build/QA: Retire nullCoalesce.property baseline - #13982
huzaifaalmesbah wants to merge 2 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. 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. |
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. |
Description
This PR resolves all occurrences of
nullCoalesce.propertyand completely retirestests/phpstan/baselines/nullCoalesce.property.neon:src/wp-includes/class-wp-locale.php:$this->word_count_typeis uninitialized / null untilinit()callsget_word_count_type(), which uses$this->word_count_type ?? _x( 'words', ... )to fall back to the localized word count translation. Updating the property's PHPDoc@vartag fromstringtostring|nullaccurately documents its lifecycle and resolves thenullCoalesce.propertystatic analysis error without breaking locale-specific word/character counting.src/wp-includes/general-template.php:WP_Query::$max_num_pagesis non-nullable (int). Adjusted$wp_query->max_num_pages ?? 1to! empty( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1to preserve correct fallback whenmax_num_pagesis 0.src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:WP_Post_Type::$templateis initialized asarray(). Simplified$post_type->template ?? array()to$post_type->template.Testing Instructions
composer phpstanlocally to verify 0 errors.Trac ticket: https://core.trac.wordpress.org/ticket/65817
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Assisting with static analysis archaeology, tests, and diff preparation; all code and tests were manually reviewed, verified, and locally run by me.