From 0d4529b3458d8dd2920deecddd75bd032e32eae0 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 9 Oct 2026 11:40:53 -0700 Subject: [PATCH 1/2] Fix assign.propertyType error for is_closing_tag by allowing nullable --- src/wp-includes/html-api/class-wp-html-tag-processor.php | 2 +- tests/phpstan/baselines/assign.propertyType.neon | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) 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 7a12fce2d1d70..854466f8b36d9 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 @@ -690,7 +690,7 @@ class WP_HTML_Tag_Processor { * Whether the current tag is an opening tag, e.g.
, or a closing tag, e.g.
. * * @since 6.2.0 - * @var bool + * @var bool|null */ private $is_closing_tag; diff --git a/tests/phpstan/baselines/assign.propertyType.neon b/tests/phpstan/baselines/assign.propertyType.neon index be2401759f2c8..bce07c243c734 100644 --- a/tests/phpstan/baselines/assign.propertyType.neon +++ b/tests/phpstan/baselines/assign.propertyType.neon @@ -108,11 +108,6 @@ parameters: identifier: assign.propertyType count: 1 path: ../../../src/wp-includes/customize/class-wp-customize-header-image-control.php - - - message: '#^Property WP_HTML_Tag_Processor\:\:\$is_closing_tag \(bool\) does not accept null\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - message: '#^Property WP_Translation_File\:\:\$entries \(array\\) does not accept array\\>\.$#' identifier: assign.propertyType From 46db8627522ceb01ea0ed1ebcb3633141d2d3e98 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 9 Oct 2026 11:43:12 -0700 Subject: [PATCH 2/2] Fix isset.property errors as WP_HTML_Text_Replacement::$text is always string --- src/wp-includes/html-api/class-wp-html-tag-processor.php | 2 +- tests/phpstan/baselines/isset.property.neon | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) 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 854466f8b36d9..afd4dca2c0e6a 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 @@ -2767,7 +2767,7 @@ private static function sort_start_ascending( WP_HTML_Text_Replacement $a, WP_HT return $by_start; } - $by_text = isset( $a->text, $b->text ) ? strcmp( $a->text, $b->text ) : 0; + $by_text = strcmp( $a->text, $b->text ); if ( 0 !== $by_text ) { return $by_text; } diff --git a/tests/phpstan/baselines/isset.property.neon b/tests/phpstan/baselines/isset.property.neon index f5e272b598f34..5590e90865e7e 100644 --- a/tests/phpstan/baselines/isset.property.neon +++ b/tests/phpstan/baselines/isset.property.neon @@ -158,11 +158,6 @@ parameters: identifier: isset.property count: 1 path: ../../../src/wp-includes/customize/class-wp-customize-partial.php - - - message: '#^Property WP_HTML_Text_Replacement\:\:\$text \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php - message: '#^Property WP_Post\:\:\$post_status \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property