diff --git a/phpstan.neon.dist b/phpstan.neon.dist index fa1e3f209c322..e2e72fb367482 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -29,7 +29,6 @@ includes: - tests/phpstan/baselines/assign.propertyType.neon - tests/phpstan/baselines/binaryOp.invalid.neon - tests/phpstan/baselines/booleanAnd.alwaysFalse.neon - - tests/phpstan/baselines/booleanAnd.alwaysTrue.neon - tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon - tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon - tests/phpstan/baselines/booleanNot.alwaysFalse.neon @@ -80,7 +79,6 @@ includes: - tests/phpstan/baselines/property.phpDocType.neon - tests/phpstan/baselines/property.private.neon - tests/phpstan/baselines/property.protected.neon - - tests/phpstan/baselines/property.unusedType.neon - tests/phpstan/baselines/return.empty.neon - tests/phpstan/baselines/return.missing.neon - tests/phpstan/baselines/return.type.neon diff --git a/src/wp-includes/html-api/class-wp-html-tag-processor.php b/src/wp-includes/html-api/class-wp-html-tag-processor.php index 41788ba102a67..dd99a8324b5c6 100644 --- a/src/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/src/wp-includes/html-api/class-wp-html-tag-processor.php @@ -1728,6 +1728,8 @@ private function skip_script_data(): bool { * @ignore * * @return bool Whether a tag was found before the end of the document. + * + * @phpstan-impure */ private function parse_next_tag(): bool { $this->after_tag(); diff --git a/tests/phpstan/baselines/booleanAnd.alwaysTrue.neon b/tests/phpstan/baselines/booleanAnd.alwaysTrue.neon deleted file mode 100644 index 52bae4992b186..0000000000000 --- a/tests/phpstan/baselines/booleanAnd.alwaysTrue.neon +++ /dev/null @@ -1,25 +0,0 @@ -# PHPStan baseline for the `booleanAnd.alwaysTrue` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/booleanAnd.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=booleanAnd.alwaysTrue -# -# which reruns the analysis with this file suppressed so the errors surface again. - -parameters: - ignoreErrors: - - - message: '#^Result of && is always true\.$#' - identifier: booleanAnd.alwaysTrue - count: 2 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php diff --git a/tests/phpstan/baselines/deadCode.unreachable.neon b/tests/phpstan/baselines/deadCode.unreachable.neon index f8a2c6671a783..0bd31fe524a9a 100644 --- a/tests/phpstan/baselines/deadCode.unreachable.neon +++ b/tests/phpstan/baselines/deadCode.unreachable.neon @@ -288,11 +288,6 @@ parameters: identifier: deadCode.unreachable count: 31 path: ../../../src/wp-includes/html-api/class-wp-html-processor.php - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - message: '#^Unreachable statement \- code above always terminates\.$#' identifier: deadCode.unreachable diff --git a/tests/phpstan/baselines/identical.alwaysFalse.neon b/tests/phpstan/baselines/identical.alwaysFalse.neon index 47e10c0e67b9a..53a42542a0410 100644 --- a/tests/phpstan/baselines/identical.alwaysFalse.neon +++ b/tests/phpstan/baselines/identical.alwaysFalse.neon @@ -28,11 +28,6 @@ parameters: identifier: identical.alwaysFalse count: 1 path: ../../../src/wp-includes/html-api/class-wp-html-processor.php - - - message: '#^Strict comparison using \=\=\= between ''STATE_INCOMPLETE…'' and ''STATE_READY'' will always evaluate to false\.$#' - identifier: identical.alwaysFalse - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - message: '#^Strict comparison using \=\=\= between 3000000000 and 2147483647 will always evaluate to false\.$#' identifier: identical.alwaysFalse diff --git a/tests/phpstan/baselines/method.unused.neon b/tests/phpstan/baselines/method.unused.neon index f4314a8b42a5c..bf95fbb71715c 100644 --- a/tests/phpstan/baselines/method.unused.neon +++ b/tests/phpstan/baselines/method.unused.neon @@ -33,13 +33,3 @@ parameters: identifier: method.unused count: 1 path: ../../../src/wp-includes/class-wp-script-modules.php - - - message: '#^Method WP_HTML_Tag_Processor\:\:skip_rawtext\(\) is unused\.$#' - identifier: method.unused - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - - - message: '#^Method WP_HTML_Tag_Processor\:\:skip_script_data\(\) is unused\.$#' - identifier: method.unused - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php diff --git a/tests/phpstan/baselines/notIdentical.alwaysTrue.neon b/tests/phpstan/baselines/notIdentical.alwaysTrue.neon index 631833a87c3ee..99fe5295c9d55 100644 --- a/tests/phpstan/baselines/notIdentical.alwaysTrue.neon +++ b/tests/phpstan/baselines/notIdentical.alwaysTrue.neon @@ -38,21 +38,6 @@ parameters: identifier: notIdentical.alwaysTrue count: 1 path: ../../../src/wp-includes/functions.php - - - message: '#^Strict comparison using \!\=\= between ''STATE_COMPLETE'' and ''STATE_READY'' will always evaluate to true\.$#' - identifier: notIdentical.alwaysTrue - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - - - message: '#^Strict comparison using \!\=\= between ''STATE_INCOMPLETE…'' and ''STATE_READY'' will always evaluate to true\.$#' - identifier: notIdentical.alwaysTrue - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - - - message: '#^Strict comparison using \!\=\= between ''STATE_MATCHED_TAG'' and ''STATE_READY'' will always evaluate to true\.$#' - identifier: notIdentical.alwaysTrue - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - message: '#^Strict comparison using \!\=\= between 0 and int\\|int\<1, max\> will always evaluate to true\.$#' identifier: notIdentical.alwaysTrue diff --git a/tests/phpstan/baselines/property.unusedType.neon b/tests/phpstan/baselines/property.unusedType.neon deleted file mode 100644 index 9f1bd06e86c8f..0000000000000 --- a/tests/phpstan/baselines/property.unusedType.neon +++ /dev/null @@ -1,25 +0,0 @@ -# PHPStan baseline for the `property.unusedType` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/property.unusedType -# -# 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=property.unusedType -# -# which reruns the analysis with this file suppressed so the errors surface again. - -parameters: - ignoreErrors: - - - message: '#^Property WP_HTML_Tag_Processor\:\:\$skip_newline_at \(int\|null\) is never assigned int so it can be removed from the property type\.$#' - identifier: property.unusedType - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php