Repository navigation
Code Quality: Document theme JSON resolver cached properties as nullable - #15385
westonruter wants to merge 1 commit into
Conversation
The static caches `$core`, `$blocks`, `$theme`, `$user`, `$user_custom_post_type_id`, and `$i18n_schema` on `WP_Theme_JSON_Resolver` all default to `null` and are reset to `null` in `clean_cached_data()`, but their `@var` tags left out `null`. Add it, and drop the six resulting `assign.propertyType` entries from the PHPStan baseline. This mirrors the same fix to `WP_Theme_JSON_Resolver_Gutenberg` in Gutenberg. Co-Authored-By: Claude Opus 5.5 (high effort) <noreply@anthropic.com> Claude-Code-Session-Id: e6cf5d9d-7b29-4126-899f-5239ba40d63b
|
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:
|
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. |
The cached static properties of `WP_Theme_JSON_Resolver` all default to `null` and are reset to `null` in `clean_cached_data()`, and the getters check them against `null` to decide whether to rebuild the cache, but their `@var` tags omitted `null`. Adding it removes the six resulting `assign.propertyType` entries from the PHPStan baseline. There is no runtime change. This mirrors the same fix to `WP_Theme_JSON_Resolver_Gutenberg` in the Gutenberg plugin, developed in WordPress/gutenberg#86111. Developed in #15385. Follow-up to r50959, r52049, r54493, r63022. Props noruzzaman, huzaifaalmesbah. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@65218 602fd350-edb4-49c9-b593-d223f7449a82
The cached static properties of `WP_Theme_JSON_Resolver` all default to `null` and are reset to `null` in `clean_cached_data()`, and the getters check them against `null` to decide whether to rebuild the cache, but their `@var` tags omitted `null`. Adding it removes the six resulting `assign.propertyType` entries from the PHPStan baseline. There is no runtime change. This mirrors the same fix to `WP_Theme_JSON_Resolver_Gutenberg` in the Gutenberg plugin, developed in WordPress/gutenberg#86111. Developed in WordPress/wordpress-develop#15385. Follow-up to r50959, r52049, r54493, r63022. Props noruzzaman, huzaifaalmesbah. See #65817. Built from https://develop.svn.wordpress.org/trunk@65218 git-svn-id: http://core.svn.wordpress.org/trunk@64367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
✅ Committed in r65218 (77b1804).
The static caches
$core,$blocks,$theme,$user,$user_custom_post_type_id, and$i18n_schemaonWP_Theme_JSON_Resolverall default tonulland are reset tonullinclean_cached_data(), but their@vartags omittednull. This adds|nullto each tag and removes the six resultingassign.propertyTypeentries fromtests/phpstan/baselines/assign.propertyType.neon(regenerated viacomposer phpstan:baselines). There is no runtime change.Gutenberg companion PR: WordPress/gutenberg#86111
Trac ticket: Core-65817
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5 · high effort
Used for: Reviewing the Gutenberg companion PR, porting the same docblock fix to core, regenerating the PHPStan baseline, and drafting this description. The change was reviewed by me.
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.