From 419082228e45e8b98bc192d93dffd12281adfc51 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Sun, 16 Aug 2026 13:51:02 -0700 Subject: [PATCH] fix: remove greater.invalid baseline and fix its issue --- phpstan.neon.dist | 1 - src/wp-admin/includes/upgrade.php | 6 ----- tests/phpstan/baselines/greater.invalid.neon | 25 -------------------- 3 files changed, 32 deletions(-) delete mode 100644 tests/phpstan/baselines/greater.invalid.neon diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e2e72fb367482..a11f5a568f5c6 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -47,7 +47,6 @@ includes: - tests/phpstan/baselines/function.alreadyNarrowedType.neon - tests/phpstan/baselines/function.impossibleType.neon - tests/phpstan/baselines/function.resultUnused.neon - - tests/phpstan/baselines/greater.invalid.neon - tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon - tests/phpstan/baselines/identical.alwaysFalse.neon - tests/phpstan/baselines/identical.alwaysTrue.neon diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 914113bde00d0..f58fa36889c99 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -2046,12 +2046,6 @@ function upgrade_430_fix_comments() { 'type' => 'byte', 'length' => 65535, ); - } elseif ( ! is_array( $content_length ) ) { - $length = (int) $content_length > 0 ? (int) $content_length : 65535; - $content_length = array( - 'type' => 'byte', - 'length' => $length, - ); } if ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) { diff --git a/tests/phpstan/baselines/greater.invalid.neon b/tests/phpstan/baselines/greater.invalid.neon deleted file mode 100644 index bf9ca0aa0250f..0000000000000 --- a/tests/phpstan/baselines/greater.invalid.neon +++ /dev/null @@ -1,25 +0,0 @@ -# PHPStan baseline for the `greater.invalid` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/greater.invalid -# -# 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=greater.invalid -# -# which reruns the analysis with this file suppressed so the errors surface again. - -parameters: - ignoreErrors: - - - message: '#^Comparison operation "\>" between \*NEVER\* and 0 results in an error\.$#' - identifier: greater.invalid - count: 1 - path: ../../../src/wp-admin/includes/upgrade.php