Commit 9ef87f373a for wordpress.org

commit 9ef87f373ad72aa9ca82a19b60f7110f297dbebe
Author: westonruter <westonruter@git.wordpress.org>
Date:   Wed Nov 25 21:08:47 2026 +0000

    Code Quality: Resolve the `varTag.noVariable` PHPStan errors.

    PHPStan reports `varTag.noVariable` for a `@var` tag that names no variable and is not above a local variable assignment, since such a tag has nothing to apply to. Eight of these were above `define()` calls, which declare no variable, and they are removed. No type information is lost, since PHPStan reads the types of the constants that vary by environment from `dynamicConstantNames` and infers the others from their values. The tag for `CUSTOM_TAGS` was also wrong, as it described the constant as an array of tags rather than a flag, so its docblock now explains that defining it as `true` uses the KSES globals in place of the defaults.

    The other nine were above assignments to `WP_Query` properties, where they were added in r49700 to help IDEs narrow the union property types. Neither PHPStan nor !PhpStorm applied them, and PHPStan already narrows each property from the assigned value, so they are removed as well. Two similar tags above local variables in `WP_Query::get_posts()` are also removed, since they only overrode the types PHPStan infers, one of them with a less precise type. This empties the baseline, so it is removed.

    Developed in https://github.com/WordPress/wordpress-develop/pull/15449.
    Follow-up to r49700, r49927, r63020.

    Props mukesh27, westonruter.
    See #66739.

    Built from https://develop.svn.wordpress.org/trunk@65794


    git-svn-id: http://core.svn.wordpress.org/trunk@64823 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-admin/install.php b/wp-admin/install.php
index 85ae31b68b..4a6a57c4be 100644
--- a/wp-admin/install.php
+++ b/wp-admin/install.php
@@ -27,7 +27,6 @@ if ( false ) {
  * We are installing WordPress.
  *
  * @since 1.5.1
- * @var bool
  */
 define( 'WP_INSTALLING', true );

diff --git a/wp-admin/profile.php b/wp-admin/profile.php
index 18fb60069b..e7afba6631 100644
--- a/wp-admin/profile.php
+++ b/wp-admin/profile.php
@@ -10,7 +10,6 @@
  * This is a profile page.
  *
  * @since 2.5.0
- * @var bool
  */
 define( 'IS_PROFILE_PAGE', true );

diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php
index 69a7b7693b..da84dc4466 100644
--- a/wp-admin/upgrade.php
+++ b/wp-admin/upgrade.php
@@ -10,7 +10,6 @@
  * We are upgrading WordPress.
  *
  * @since 1.5.1
- * @var bool
  */
 define( 'WP_INSTALLING', true );

diff --git a/wp-cron.php b/wp-cron.php
index 417dcce375..92dfb67b92 100644
--- a/wp-cron.php
+++ b/wp-cron.php
@@ -36,8 +36,6 @@ if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) {

 /**
  * Tell WordPress the cron task is running.
- *
- * @var bool
  */
 define( 'DOING_CRON', true );

diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php
index 5adeac3dd6..0c07cb26bf 100644
--- a/wp-includes/class-wp-query.php
+++ b/wp-includes/class-wp-query.php
@@ -2921,7 +2921,6 @@ class WP_Query {
 			_prime_comment_caches( $comment_ids );

 			// Convert to WP_Comment.
-			/** @var WP_Comment[] */
 			$this->comments      = array_map( 'get_comment', $comment_ids );
 			$this->comment_count = count( $this->comments );

@@ -3289,7 +3288,6 @@ class WP_Query {

 				if ( $cached_results ) {
 					$cache_found = true;
-					/** @var int[] */
 					$post_ids = array_map( 'intval', $cached_results['posts'] );

 					$this->post_count    = count( $post_ids );
@@ -3327,7 +3325,6 @@ class WP_Query {
 						return $post_parents;
 					} else {
 						_prime_post_caches( $post_ids, $query_vars['update_post_term_cache'], $query_vars['update_post_meta_cache'] );
-						/** @var WP_Post[] */
 						$this->posts = array_map( 'get_post', $post_ids );
 					}
 				}
@@ -3337,7 +3334,6 @@ class WP_Query {
 		if ( 'ids' === $query_vars['fields'] ) {
 			$this->posts ??= $wpdb->get_col( $this->request );

-			/** @var int[] */
 			$this->posts      = array_map( 'intval', $this->posts );
 			$this->post_count = count( $this->posts );
 			$this->set_found_posts( $query_vars, $limits );
@@ -3361,7 +3357,6 @@ class WP_Query {
 			$this->post_count = count( $this->posts );
 			$this->set_found_posts( $query_vars, $limits );

-			/** @var int[] */
 			$post_parents       = array();
 			$post_ids           = array();
 			$post_parents_cache = array();
@@ -3468,7 +3463,6 @@ class WP_Query {

 		// Convert to WP_Post objects.
 		if ( $this->posts ) {
-			/** @var WP_Post[] */
 			$this->posts = array_map( 'get_post', $this->posts );
 		}

@@ -3591,7 +3585,6 @@ class WP_Query {
 			_prime_comment_caches( $comment_ids );

 			// Convert to WP_Comment.
-			/** @var WP_Comment[] */
 			$this->comments      = array_map( 'get_comment', $comment_ids );
 			$this->comment_count = count( $this->comments );
 		}
@@ -3665,7 +3658,6 @@ class WP_Query {
 		if ( $this->posts ) {
 			$this->post_count = count( $this->posts );

-			/** @var WP_Post[] */
 			$this->posts = array_map( 'get_post', $this->posts );

 			if ( $query_vars['cache_results'] ) {
@@ -3677,7 +3669,6 @@ class WP_Query {
 				}
 			}

-			/** @var WP_Post */
 			$this->post = reset( $this->posts );
 		} else {
 			$this->post_count = 0;
@@ -3771,7 +3762,6 @@ class WP_Query {

 		++$this->current_post;

-		/** @var WP_Post */
 		$this->post = $this->posts[ $this->current_post ];
 		return $this->post;
 	}
@@ -3918,7 +3908,6 @@ class WP_Query {
 	public function next_comment() {
 		++$this->current_comment;

-		/** @var WP_Comment */
 		$this->comment = $this->comments[ $this->current_comment ];
 		return $this->comment;
 	}
diff --git a/wp-includes/kses.php b/wp-includes/kses.php
index f2195e2f33..a9cb15b90e 100644
--- a/wp-includes/kses.php
+++ b/wp-includes/kses.php
@@ -31,12 +31,12 @@
  */

 /**
- * Specifies the default allowable HTML tags.
+ * Whether to use custom allowed HTML tags from the KSES globals.
  *
  * Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The
  * {@see 'wp_kses_allowed_html'} filter is more powerful and supplies context.
  *
- * When using this constant, make sure to set all of these globals to arrays:
+ * To use custom tags, define this constant as `true` and set all of these globals to arrays:
  *
  *  - `$allowedposttags`
  *  - `$allowedtags`
@@ -45,8 +45,6 @@
  *
  * @see wp_kses_allowed_html()
  * @since 1.2.0
- *
- * @var array[]|false Array of default allowable HTML tags, or false to use the defaults.
  */
 if ( ! defined( 'CUSTOM_TAGS' ) ) {
 	define( 'CUSTOM_TAGS', false );
diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php
index 4438594bae..7b90f5fdc0 100644
--- a/wp-includes/rest-api.php
+++ b/wp-includes/rest-api.php
@@ -9,8 +9,6 @@

 /**
  * Version number for our API.
- *
- * @var string
  */
 define( 'REST_API_VERSION', '2.0' );

@@ -485,7 +483,6 @@ function rest_api_loaded() {
 	 * Whether this is a REST Request.
 	 *
 	 * @since 4.4.0
-	 * @var bool
 	 */
 	define( 'REST_REQUEST', true );

diff --git a/wp-includes/version.php b/wp-includes/version.php
index b2aa2784b5..f25917361a 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.3-alpha-65793';
+$wp_version = '7.3-alpha-65794';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/xmlrpc.php b/xmlrpc.php
index ae73f687a2..bbf170d112 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -7,8 +7,6 @@

 /**
  * Whether this is an XML-RPC Request.
- *
- * @var bool
  */
 define( 'XMLRPC_REQUEST', true );