[wp-trac] [WordPress Trac] #64898: PHPStan code quality improvements for 7.1
WordPress Trac
noreply at wordpress.org
Sat May 2 05:16:17 UTC 2026
#64898: PHPStan code quality improvements for 7.1
--------------------------------------+-------------------------------
Reporter: desrosj | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 7.1
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: coding-standards
--------------------------------------+-------------------------------
Comment (by westonruter):
In [changeset:"62292" 62292]:
{{{
#!CommitTicketReference repository="" revision="62292"
Build/Test Tools: Honor `@global` docblock tags in PHPStan analysis.
This adds a PHPStan extension with a parser-node visitor that bridges
WordPress core's `@global Type $varname` PHPDoc convention to PHPStan's
variable type resolution, eliminating 3,784 spurious errors caused by
globals resolving as `mixed` when on rule level 10 (out of 40,069 errors
total, so a 9.4% reduction). This avoids the need to add `/** @var Type
$varname */` annotations with each global variable.
Developed in https://github.com/WordPress/wordpress-develop/pull/11692
Props westonruter, apermo, szepeviktor.
See #64898.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64898#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list