From 8ed96e66b1f12a42b9ba027e47d62e53ce6f541d Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 15 Nov 2026 20:42:19 -0800 Subject: [PATCH 1/2] Build/Test Tools: Update PHPStan to 2.3.6. When only part of the project is analyzed, such as a single directory or a list of files, PHPStan 2.3.6 no longer reports `ignoreErrors` entries as unmatched merely because what they ignore lies outside the analysis. The result cache also now tracks the symbols each file looked up, rather than reanalyzing every file with errors on each run. The release adds full support for PHP 8.6 and float range types, along with many fixes to type narrowing. The baselines are regenerated for what the update changes in the analysis: three `variable.undefined` errors are no longer reported, the message of an `offsetAccess.notFound` error now names the range of the offset, and the two `assign.propertyType` errors for `WP_Query::$posts` are each reported for a second assignment as well. Co-Authored-By: Claude Opus 5.5 (medium effort) Claude-Session: https://claude.ai/code/session_01Tnky3Grhn8Rv7MidzhrtXU Claude-Code-Session-Id: d102d8d5-ffa7-4c14-add5-1e05d41fe751 --- composer.json | 2 +- tests/phpstan/baselines/assign.propertyType.neon | 4 ++-- .../phpstan/baselines/offsetAccess.notFound.neon | 2 +- tests/phpstan/baselines/variable.undefined.neon | 15 --------------- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index fe6d3fa924bc9..0da0b833e6937 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "squizlabs/php_codesniffer": "3.13.5", "wp-coding-standards/wpcs": "~3.4.1", "phpcompatibility/phpcompatibility-wp": "~2.1.3", - "phpstan/phpstan": "2.3.5", + "phpstan/phpstan": "2.3.6", "phpstan/phpstan-phpunit": "2.1.1", "phpstan/phpstan-strict-rules": "2.1.1", "yoast/phpunit-polyfills": "^1.1.0" diff --git a/tests/phpstan/baselines/assign.propertyType.neon b/tests/phpstan/baselines/assign.propertyType.neon index a4ea6afb84d31..80b4b8b9b43c1 100644 --- a/tests/phpstan/baselines/assign.propertyType.neon +++ b/tests/phpstan/baselines/assign.propertyType.neon @@ -36,12 +36,12 @@ parameters: - message: '#^Property WP_Query\:\:\$posts \(array\\|null\) does not accept list\\|null\.$#' identifier: assign.propertyType - count: 1 + count: 2 path: ../../../src/wp-includes/class-wp-query.php - message: '#^Property WP_Query\:\:\$posts \(array\\|null\) does not accept list\\.$#' identifier: assign.propertyType - count: 1 + count: 2 path: ../../../src/wp-includes/class-wp-query.php - message: '#^Property WP_Rewrite\:\:\$rules \(array\\) does not accept string\.$#' diff --git a/tests/phpstan/baselines/offsetAccess.notFound.neon b/tests/phpstan/baselines/offsetAccess.notFound.neon index 4470319b88805..a27d5cc14f437 100644 --- a/tests/phpstan/baselines/offsetAccess.notFound.neon +++ b/tests/phpstan/baselines/offsetAccess.notFound.neon @@ -19,7 +19,7 @@ parameters: ignoreErrors: - - message: '#^Offset float does not exist on list\\.$#' + message: '#^Offset float\<0\.0, max\> does not exist on list\\.$#' identifier: offsetAccess.notFound count: 1 path: ../../../src/wp-admin/includes/class-wp-site-health.php diff --git a/tests/phpstan/baselines/variable.undefined.neon b/tests/phpstan/baselines/variable.undefined.neon index 1192b132f2626..94ac3791e4bed 100644 --- a/tests/phpstan/baselines/variable.undefined.neon +++ b/tests/phpstan/baselines/variable.undefined.neon @@ -18,11 +18,6 @@ parameters: ignoreErrors: - - - message: '#^Variable \$pagenow might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../src/wp-admin/admin.php - message: '#^Variable \$wp_db_version might not be defined\.$#' identifier: variable.undefined @@ -693,11 +688,6 @@ parameters: identifier: variable.undefined count: 3 path: ../../../src/wp-includes/ms-files.php - - - message: '#^Variable \$current_blog might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../../src/wp-includes/ms-settings.php - message: '#^Variable \$table_prefix might not be defined\.$#' identifier: variable.undefined @@ -708,11 +698,6 @@ parameters: identifier: variable.undefined count: 3 path: ../../../src/wp-includes/ms-settings.php - - - message: '#^Variable \$wp_template_path might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../src/wp-includes/template.php - message: '#^Variable \$error might not be defined\.$#' identifier: variable.undefined From 6cfe0b982accbaf483aab0d7803482cff2087ae9 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 16 Nov 2026 12:41:00 -0800 Subject: [PATCH 2/2] Build/Test Tools: Update the PHPStan PHPUnit extension to 2.1.2. The extension now narrows types after `assertGreaterThan()` and `assertLessThan()`, and reports a data provider that provides no data sets. Neither changes what PHPStan reports for core, so the baselines are unchanged. Co-Authored-By: Claude Opus 5.5 (medium effort) Claude-Session: https://claude.ai/code/session_01Tnky3Grhn8Rv7MidzhrtXU Claude-Code-Session-Id: d102d8d5-ffa7-4c14-add5-1e05d41fe751 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0da0b833e6937..dd7f57d5b6313 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "wp-coding-standards/wpcs": "~3.4.1", "phpcompatibility/phpcompatibility-wp": "~2.1.3", "phpstan/phpstan": "2.3.6", - "phpstan/phpstan-phpunit": "2.1.1", + "phpstan/phpstan-phpunit": "2.1.2", "phpstan/phpstan-strict-rules": "2.1.1", "yoast/phpunit-polyfills": "^1.1.0" },