[wp-trac] [WordPress Trac] #61175: Integrate PHPStan into the core development workflow

WordPress Trac noreply at wordpress.org
Sat May 31 17:48:01 UTC 2025


#61175: Integrate PHPStan into the core development workflow
--------------------------------------+---------------------
 Reporter:  westonruter               |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  6.9
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by justlevine):

 In addition to dropping back to WP 7.2, the last several commits saw some
 other fine-tuning of the PHPStan config:

 - `missingType.return` is now ignored (Level 6), since it's too noisy
 until we start inlining `: void` into our function signatures. (Per WPCS
 we dont `@return void`).
 - `dynamicConstantNames` has been given an initial list of constants
 - `treatPhpDocTypesAsCertain` has been turned back on to remove a bunch of
 false positives. (While imo this hinders the ability to see remediation
 opportunities, it is technically the correct config choice).

 As a result, and per the latest rebase, the counts are as follows.
 (New/remediated doesnt make sense so I'm just noting the changes).

 Versus 9 May: https://core.trac.wordpress.org/ticket/61175#comment:22

 ||= PHPStan Level =||= Error Count =||= Changed since last =||= Notes =||
 || 0 || 10 || +1 || ||
 || 1 || 34 || -29 || mainly from `treatPHPDocTypesAsCertain:false` ||
 || 2 || 525 || +212 || mainly from drop to PHPStan 1.x ||
 || 3 || 185 || -10 || ||
 || 4 || 264 || -723 || mix of `dynamicConstantNames` and
 `treatPHPDocTypesAsCertain:false` ||
 || 5 || 498 || -59 || ||
 || 6 || 108 || -2026 || mainly ignoring `missingType.return` ||

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61175#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list