[wp-trac] [WordPress Trac] #64702: Code Modernization: Replace void in PHPDoc union return types with null in Administration

WordPress Trac noreply at wordpress.org
Mon Mar 30 06:02:15 UTC 2026


#64702: Code Modernization: Replace void in PHPDoc union return types with null in
Administration
--------------------------+--------------------------
 Reporter:  apermo        |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  7.1
Component:  General       |     Version:  4.3
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------
Changes (by westonruter):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"62179" 62179]:
 {{{
 #!CommitTicketReference repository="" revision="62179"
 Code Quality: Replace `void` with proper return types in Administration
 PHPDoc annotations.

 Replace `void` in union return types with `null` or remove it where the
 function always returns a value or dies, across 8 files in `wp-
 admin/includes`. Adds explicit `return null;` statements where functions
 previously fell through without a return value.

 Additionally:
 * Adds `@return never` for `media_send_to_editor()` and removes misleading
 `return` from its callers.
 * Removes `void` from return types where the function always returns a
 value or exits: `write_post()`, `WP_Importer::set_blog()`,
 `WP_Importer::set_user()`.
 * Replaces `mixed|void` with a specific array shape for
 `WP_Site_Health::perform_test()`.

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

 Follow-up to r62178, r62177, r61766, r61719.

 Props apermo, xate, westonruter, mukesh27, desrosj.
 Fixes #64702.
 }}}

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


More information about the wp-trac mailing list