diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 248623a5c01d6..bb806bc4a4b95 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..37e15696d446a 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -2037,24 +2037,14 @@ function upgrade_430_fix_comments() { $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' ); - if ( is_wp_error( $content_length ) ) { - return; - } - if ( false === $content_length ) { $content_length = array( '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'] ) { + if ( ! is_array( $content_length ) || 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) { // Sites with malformed DB schemas are on their own. return; } 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