From 27c65a99cfda6e3783f6c58956307b09412a6ccf Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sat, 28 Feb 2026 19:59:46 +0000 Subject: [PATCH] Code Quality: Add `@phpstan-assert-if-true` to `is_wp_error()`. This ensures PHPStan is aware that passing a `WP_Error` instance to `is_wp_error()` will cause the function to return `true`. This reduces the total number of PHPStan errors at rule level 7 from 14,271 to 13,233 (-1,038 or -7.27%). Developed in https://github.com/WordPress/wordpress-develop/pull/11095 See #64238. Built from https://develop.svn.wordpress.org/trunk@61774 git-svn-id: http://core.svn.wordpress.org/trunk@61080 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/load.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/load.php b/wp-includes/load.php index 90318acddd..27c58b57dd 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -1798,6 +1798,8 @@ function wp_doing_cron() { * * @param mixed $thing The variable to check. * @return bool Whether the variable is an instance of WP_Error. + * + * @phpstan-assert-if-true WP_Error $thing */ function is_wp_error( $thing ) { $is_wp_error = ( $thing instanceof WP_Error ); diff --git a/wp-includes/version.php b/wp-includes/version.php index fa4eb99c80..5e1af336cb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.0-beta2-61773'; +$wp_version = '7.0-beta2-61774'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.