Commit 87fee7675b for wordpress.org
commit 87fee7675bda1586b9940ef0f4f696cecdd57fd0
Author: westonruter <westonruter@git.wordpress.org>
Date: Tue Nov 3 03:45:02 2026 +0000
Code Quality: Document theme JSON resolver caches as nullable.
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 https://github.com/WordPress/gutenberg/pull/86111.
Developed in https://github.com/WordPress/wordpress-develop/pull/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
diff --git a/wp-includes/class-wp-theme-json-resolver.php b/wp-includes/class-wp-theme-json-resolver.php
index c8129e1ebc..42a64809d8 100644
--- a/wp-includes/class-wp-theme-json-resolver.php
+++ b/wp-includes/class-wp-theme-json-resolver.php
@@ -47,7 +47,7 @@ class WP_Theme_JSON_Resolver {
* Container for data coming from core.
*
* @since 5.8.0
- * @var WP_Theme_JSON
+ * @var WP_Theme_JSON|null
*/
protected static $core = null;
@@ -55,7 +55,7 @@ class WP_Theme_JSON_Resolver {
* Container for data coming from the blocks.
*
* @since 6.1.0
- * @var WP_Theme_JSON
+ * @var WP_Theme_JSON|null
*/
protected static $blocks = null;
@@ -63,7 +63,7 @@ class WP_Theme_JSON_Resolver {
* Container for data coming from the theme.
*
* @since 5.8.0
- * @var WP_Theme_JSON
+ * @var WP_Theme_JSON|null
*/
protected static $theme = null;
@@ -71,7 +71,7 @@ class WP_Theme_JSON_Resolver {
* Container for data coming from the user.
*
* @since 5.9.0
- * @var WP_Theme_JSON
+ * @var WP_Theme_JSON|null
*/
protected static $user = null;
@@ -80,7 +80,7 @@ class WP_Theme_JSON_Resolver {
* that holds the user data.
*
* @since 5.9.0
- * @var int
+ * @var int|null
*/
protected static $user_custom_post_type_id = null;
@@ -89,7 +89,7 @@ class WP_Theme_JSON_Resolver {
*
* @since 5.8.0 As `$theme_json_i18n`.
* @since 5.9.0 Renamed from `$theme_json_i18n` to `$i18n_schema`.
- * @var array
+ * @var array|null
*/
protected static $i18n_schema = null;
diff --git a/wp-includes/version.php b/wp-includes/version.php
index f5c5412830..49f58f5f7f 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta3-65217';
+$wp_version = '7.2-beta3-65218';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.