Make WordPress Core


Ignore:
Timestamp:
10/07/2026 10:00:30 PM (3 days ago)
Author:
westonruter
Message:

Build/Test Tools: Update PHPStan to 2.3.0.

This also updates phpstan/phpstan-phpunit to 2.1.1, which requires PHPStan 2.3. The release analyzes code more precisely, so 12 variable.undefined baseline entries no longer match. It also reports two comparisons in WP_HTML_Processor::run_adoption_agency_algorithm() as constant: every path through the outer loop body returns or calls bail(), so the loop never runs a second time. That loop is scaffolding for parts of the algorithm that are not yet supported, so the comparisons are baselined as work still to do.

PHPStan 2.3 deprecates ResultCacheMetaExtension, which HookDocsResultCacheMetaExtension implemented to discard the whole result cache whenever a hook docblock inherited through a "This filter is documented in" reference changed. Resolving such a reference now declares each candidate file as a dependency of the file being analyzed, so editing a canonical docblock re-analyzes only the files that inherit it, and the scan of the whole tree that ran on every analysis is gone. The extension also hashed the tooling's own sources, which PHPStan 2.3 already does for every registered extension, so it is removed.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/14089.
Follow-up to r62939, r64012.

Props westonruter, swissspidy.
See #65817.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpstan.neon.dist

    r64230 r64237  
    4343        - tests/phpstan/baselines/function.impossibleType.neon
    4444        - tests/phpstan/baselines/function.resultUnused.neon
     45        - tests/phpstan/baselines/greater.alwaysTrue.neon
     46        - tests/phpstan/baselines/greaterOrEqual.alwaysFalse.neon
    4547        - tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon
    4648        - tests/phpstan/baselines/identical.alwaysFalse.neon
Note: See TracChangeset for help on using the changeset viewer.