diff --git a/phpstan.neon.dist b/phpstan.neon.dist index d6ba7f5511b3b..7bfaa2f07c9b1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -44,7 +44,6 @@ includes: - tests/phpstan/baselines/function.resultUnused.neon - tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon - tests/phpstan/baselines/identical.alwaysFalse.neon - - tests/phpstan/baselines/identical.alwaysTrue.neon - tests/phpstan/baselines/if.alwaysFalse.neon - tests/phpstan/baselines/if.alwaysTrue.neon - tests/phpstan/baselines/isset.offset.neon diff --git a/src/wp-admin/includes/class-file-upload-upgrader.php b/src/wp-admin/includes/class-file-upload-upgrader.php index 48e1aac721d1d..0f52516a0e2cd 100644 --- a/src/wp-admin/includes/class-file-upload-upgrader.php +++ b/src/wp-admin/includes/class-file-upload-upgrader.php @@ -80,9 +80,7 @@ public function __construct( $form, $urlholder ) { __( 'Return to the Plugin Installer' ) ); wp_die( __( 'Incompatible Archive.' ) . '
' . $plugins_page ); - } - - if ( 'themezip' === $form ) { + } else { $themes_page = sprintf( '%s', self_admin_url( 'theme-install.php' ), diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 36b5b23de9f00..c3bf470bfef6c 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -965,6 +965,7 @@ function rest_filter_response_fields( $response, $server, $request ) { $fields = array_map( 'trim', $fields ); // Create nested array of accepted field hierarchy. + /** @var array $fields_as_keyed */ $fields_as_keyed = array(); foreach ( $fields as $field ) { $parts = explode( '.', $field ); diff --git a/tests/phpstan/baselines/identical.alwaysTrue.neon b/tests/phpstan/baselines/identical.alwaysTrue.neon deleted file mode 100644 index 347c3326fc5fe..0000000000000 --- a/tests/phpstan/baselines/identical.alwaysTrue.neon +++ /dev/null @@ -1,30 +0,0 @@ -# PHPStan baseline for the `identical.alwaysTrue` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/identical.alwaysTrue -# -# Each entry is scoped to a single file and carries an exact occurrence count, -# so that a new instance is reported as a new error rather than being absorbed -# silently. Fixing an occurrence therefore means decrementing or removing its -# entry here as part of the same change. -# -# The goal is to empty this file and delete it, along with the `includes` entry -# for it in phpstan.neon.dist. -# -# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with -# -# composer phpstan:baselines -- --identifier=identical.alwaysTrue -# -# which reruns the analysis with this file suppressed so the errors surface again. - -parameters: - ignoreErrors: - - - message: '#^Strict comparison using \=\=\= between ''themezip'' and ''themezip'' will always evaluate to true\.$#' - identifier: identical.alwaysTrue - count: 1 - path: ../../../src/wp-admin/includes/class-file-upload-upgrader.php - - - message: '#^Strict comparison using \=\=\= between true and true will always evaluate to true\.$#' - identifier: identical.alwaysTrue - count: 1 - path: ../../../src/wp-includes/rest-api.php