[wp-trac] [WordPress Trac] #64703: Code Modernization: Replace void in PHPDoc union return types with null in class-wpdb.php

WordPress Trac noreply at wordpress.org
Mon Mar 30 05:06:48 UTC 2026


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

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


Comment:

 In [changeset:"62177" 62177]:
 {{{
 #!CommitTicketReference repository="" revision="62177"
 Code Quality: Replace `void` with proper return types in `wpdb` and
 related functions.

 Replace `void` in union return types with `null`, `false`, or `never` as
 appropriate, and add explicit `return null` statements where methods
 previously fell through without a return value.

 Methods updated in `wpdb`: `prepare()`, `print_error()`,
 `check_connection()`, `get_row()`, `get_col_info()`, `bail()`,
 `check_database_version()`.

 Also adds `@return never` to `dead_db()` and fixes the `@phpstan-return`
 syntax for `wp_die()`.

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

 Props apermo, westonruter, xate, mukesh27, SergeyBiryukov.
 Fixes #64703.
 }}}

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


More information about the wp-trac mailing list