[wp-trac] [WordPress Trac] #49922: PHP Compatibility fixes for 5.5

WordPress Trac noreply at wordpress.org
Wed May 27 22:36:21 UTC 2020


#49922: PHP Compatibility fixes for 5.5
----------------------------+-------------------------------
 Reporter:  desrosj         |       Owner:  desrosj
     Type:  task (blessed)  |      Status:  assigned
 Priority:  normal          |   Milestone:  5.5
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  coding-standards
----------------------------+-------------------------------

Comment (by johnbillion):

 Replying to [comment:9 desrosj]:
 > 2 occurrences of `list()`: 1 in `wp-includes/capabilities.php` that
 needs to be very carefully reviewed

 This code is simpler than it looks. It's plucking the object type from the
 hardcoded list of string expressions for its switch condition and
 assigning it to the `$object_type` variable. The `$_` variable is not
 used.

 This `list()` call can be replaced with `$object_type = explode( '_', $cap
 )[1]`.

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


More information about the wp-trac mailing list