[wp-trac] [WordPress Trac] #64238: PHPStan code quality improvements for 7.0

WordPress Trac noreply at wordpress.org
Sat Feb 28 19:58:54 UTC 2026


#64238: PHPStan code quality improvements for 7.0
--------------------------------------+-------------------------------
 Reporter:  SergeyBiryukov            |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  7.0
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  coding-standards
--------------------------------------+-------------------------------

Comment (by westonruter):

 In [changeset:"61774" 61774]:
 {{{
 #!CommitTicketReference repository="" revision="61774"
 Code Quality: Add `@phpstan-assert-if-true` to `is_wp_error()`.

 This ensures PHPStan is aware that passing a `WP_Error` instance to
 `is_wp_error()` will cause the function to return `true`. This reduces the
 total number of PHPStan errors at rule level 7 from 14,271 to 13,233
 (-1,038 or -7.27%).

 Developed in https://github.com/WordPress/wordpress-develop/pull/11095

 See #64238.
 }}}

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


More information about the wp-trac mailing list