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

WordPress Trac noreply at wordpress.org
Sun Apr 6 20:54:25 UTC 2025


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

Comment (by SergeyBiryukov):

 In [changeset:"60132" 60132]:
 {{{
 #!CommitTicketReference repository="" revision="60132"
 Coding Standards: Remove unnecessary conditional in
 `WP_List_Table::print_column_headers()`.

 This commit removes an unnecessary `empty()` check, where the `$class`
 variable is primed at the top of the `foreach` loop and will always be a
 non-empty array.

 To maintain readability of the source of the `$class` attribute without
 the unnecessary `empty()` check, the resulting variable has been renamed
 to `$class_attr`, instead of reusing the array.

 Follow-up to [8923], [15491].

 Props justlevine.
 See #52217.
 }}}

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


More information about the wp-trac mailing list