[wp-trac] [WordPress Trac] #52217: Fix code issues identified by PHPStan

WordPress Trac noreply at wordpress.org
Fri Jul 16 17:11:48 UTC 2021


#52217: Fix code issues identified by PHPStan
-------------------------+-------------------------------
 Reporter:  johnbillion  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.9
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  coding-standards
-------------------------+-------------------------------

Comment (by hellofromTonya):

 >Consider whether it's beneficial to add PHPStan (or Psalm or Phan)
 analysis to the build tooling and CI.

 Using it as a ''periodic auditing tool'' is valuable for the project.

 Caution: Using it will be expensive in terms of effort and time. Why?
 PHPStan will generate significant false positives. Many of these will not
 be fixable in WordPress due to backwards-compat. Many may not be valid for
 WordPress. As a result, each incident reported by PHPStan requires a deep
 review and knowledge to do the review to determine if it's a valid report
 that needs fixing.

 I agree with @jrf that it's not well suited as part of an inline CI
 workflow that runs on every PR. [https://github.com/WordPress/wordpress-
 develop/pull/853#issuecomment-881588822 Left a comment in the PR] to share
 reasoning.

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


More information about the wp-trac mailing list