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

WordPress Trac noreply at wordpress.org
Sat Nov 2 14:59:33 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:"59336" 59336]:
 {{{
 #!CommitTicketReference repository="" revision="59336"
 Docs: Add missing `void` to DocBlock `@return` types.

 This commit adds missing `void` return types to (parent) methods that can
 ''explicitly'' return `void` as one of their conditional paths.

 Addressed methods:
 * `WP_Privacy_Requests_Table::column_status()`
 * `WP_Recovery_Mode::handle_error()`
 * `WP_Widget::form()` — unlike the others, it's the ''child'' classes that
 return `void` when the method is correctly implemented.

 Note: `@return void` (where `void` is the single type returned) should not
 be used outside the default bundled themes and the PHP compatibility shims
 included in WordPress Core, as per the [https://developer.wordpress.org
 /coding-standards/inline-documentation-standards/php/ documentation
 standards].

 Follow-up to [30382], [42967], [43256], [44973], [45448].

 Props justlevine.
 See #52217, #62281.
 }}}

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


More information about the wp-trac mailing list