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

WordPress Trac noreply at wordpress.org
Fri Nov 22 19:17:52 UTC 2024


#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:"59453" 59453]:
 {{{
 #!CommitTicketReference repository="" revision="59453"
 Coding Standards: Explicitly return `null` instead of coercing `void`.

 This addresses two instances where a function that is documented as
 returning `{someType}|null` doesn't explicitly return `null`.

 Affected functions:
 * `array_key_first()`
 * `WP_REST_Posts_Controller::handle_terms()`

 Follow-up to [38832], [52038].

 Props justlevine.
 See #52217.
 }}}

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


More information about the wp-trac mailing list