Commit 16e82f8021 for wordpress.org
commit 16e82f8021c36b20a804c80ad47a13f80f55a98b
Author: lancewillett <lancewillett@git.wordpress.org>
Date: Sat Oct 31 20:08:51 2026 +0000
Build/Test Tools: Retire resolved PHPStan baselines.
Clarify pointer, metadata, and REST array types. Simplify equivalent Site Health, timezone, and upload checks while preserving the theme filter re-evaluation. Remove the resolved `empty.offset`, `booleanAnd.rightAlwaysTrue`, and `identical.alwaysTrue` baselines and the related unreachable-code entry.
Developed in: https://github.com/WordPress/wordpress-develop/pull/14027, https://github.com/WordPress/wordpress-develop/pull/14031, https://github.com/WordPress/wordpress-develop/pull/14032
Props huzaifaalmesbah.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@65149
git-svn-id: http://core.svn.wordpress.org/trunk@64298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/includes/class-file-upload-upgrader.php b/wp-admin/includes/class-file-upload-upgrader.php
index 48e1aac721..0f52516a0e 100644
--- a/wp-admin/includes/class-file-upload-upgrader.php
+++ b/wp-admin/includes/class-file-upload-upgrader.php
@@ -80,9 +80,7 @@ class File_Upload_Upgrader {
__( 'Return to the Plugin Installer' )
);
wp_die( __( 'Incompatible Archive.' ) . '<br />' . $plugins_page );
- }
-
- if ( 'themezip' === $form ) {
+ } else {
$themes_page = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'theme-install.php' ),
diff --git a/wp-admin/includes/class-wp-internal-pointers.php b/wp-admin/includes/class-wp-internal-pointers.php
index 22233884b4..448e7af914 100644
--- a/wp-admin/includes/class-wp-internal-pointers.php
+++ b/wp-admin/includes/class-wp-internal-pointers.php
@@ -48,6 +48,7 @@ final class WP_Internal_Pointers {
* 'themes.php' => 'wp390_widgets'
* )
*/
+ /** @var array<string, string|string[]> $registered_pointers */
$registered_pointers = array(
// None currently.
);
@@ -72,6 +73,7 @@ final class WP_Internal_Pointers {
* 'wp390_widgets' => array( 'edit_theme_options' )
* )
*/
+ /** @var array<string, string[]> $caps_required */
$caps_required = array(
// None currently.
);
diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php
index de0d7cd8da..b9ce4f4728 100644
--- a/wp-admin/includes/class-wp-site-health.php
+++ b/wp-admin/includes/class-wp-site-health.php
@@ -528,7 +528,6 @@ class WP_Site_Health {
$has_default_theme = false;
$has_unused_themes = false;
- $show_unused_themes = true;
$using_default_theme = false;
// Populate a list of all themes available in the install.
@@ -622,7 +621,7 @@ class WP_Site_Health {
}
}
- if ( $has_unused_themes && $show_unused_themes && ! is_multisite() ) {
+ if ( $has_unused_themes && ! is_multisite() ) {
// This is a child theme, so we want to be a bit more explicit in our messages.
if ( $active_theme->parent() ) {
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index ee4c2add91..896af458eb 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -3677,6 +3677,7 @@ function wp_read_video_metadata( $file ) {
return false;
}
+ /** @var array<string, mixed> $metadata */
$metadata = array();
if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
diff --git a/wp-content/themes/twentynineteen/header.php b/wp-content/themes/twentynineteen/header.php
index 4833558927..0212e46d34 100644
--- a/wp-content/themes/twentynineteen/header.php
+++ b/wp-content/themes/twentynineteen/header.php
@@ -41,7 +41,7 @@
<?php
twentynineteen_post_thumbnail();
the_post();
- $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null;
+ $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; // @phpstan-ignore booleanAnd.rightAlwaysTrue (Re-checked after the_post(); the filter may return a different value.)
$classes = 'entry-header';
if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) {
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 5307e33eed..d3493594cb 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -6880,9 +6880,9 @@ function wp_timezone_choice( $selected_zone, $locale = null ) {
// This determines what gets set and translated - we don't translate Etc/* strings here, they are done later.
$exists = array(
- 0 => ( isset( $zone[0] ) && $zone[0] ),
- 1 => ( isset( $zone[1] ) && $zone[1] ),
- 2 => ( isset( $zone[2] ) && $zone[2] ),
+ 0 => ! empty( $zone[0] ),
+ 1 => ! empty( $zone[1] ),
+ 2 => ! empty( $zone[2] ),
);
$exists[3] = ( $exists[0] && 'Etc' !== $zone[0] );
$exists[4] = ( $exists[1] && $exists[3] );
diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php
index 9fe15fb118..f40021f4d0 100644
--- a/wp-includes/rest-api.php
+++ b/wp-includes/rest-api.php
@@ -1072,6 +1072,7 @@ function rest_filter_response_fields( $response, $server, $request ) {
$fields = array_map( 'trim', $fields );
// Create nested array of accepted field hierarchy.
+ /** @var array<string, mixed> $fields_as_keyed */
$fields_as_keyed = array();
foreach ( $fields as $field ) {
$parts = explode( '.', $field );
diff --git a/wp-includes/version.php b/wp-includes/version.php
index aa07d52d42..254eedf4b3 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta3-65148';
+$wp_version = '7.2-beta3-65149';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.