Commit d8b6a76
committed
Code Quality: Replace
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 WordPress/wordpress-develop#11009
Props apermo, westonruter, xate, mukesh27, SergeyBiryukov.
Fixes #64703.
Built from https://develop.svn.wordpress.org/trunk@62177
git-svn-id: http://core.svn.wordpress.org/trunk@61459 1a063a9b-81f0-0310-95a4-ce76da25c4cdvoid with proper return types in wpdb and related functions.1 parent b3c93f5 commit d8b6a76
3 files changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1453 | 1453 | | |
1454 | 1454 | | |
1455 | 1455 | | |
1456 | | - | |
| 1456 | + | |
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
1460 | | - | |
| 1460 | + | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | | - | |
| 1669 | + | |
1670 | 1670 | | |
1671 | 1671 | | |
1672 | 1672 | | |
| |||
1684 | 1684 | | |
1685 | 1685 | | |
1686 | 1686 | | |
1687 | | - | |
| 1687 | + | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
| |||
1794 | 1794 | | |
1795 | 1795 | | |
1796 | 1796 | | |
1797 | | - | |
| 1797 | + | |
1798 | 1798 | | |
1799 | 1799 | | |
1800 | 1800 | | |
| |||
1855 | 1855 | | |
1856 | 1856 | | |
1857 | 1857 | | |
| 1858 | + | |
| 1859 | + | |
1858 | 1860 | | |
1859 | 1861 | | |
1860 | 1862 | | |
| |||
2117 | 2119 | | |
2118 | 2120 | | |
2119 | 2121 | | |
2120 | | - | |
| 2122 | + | |
2121 | 2123 | | |
2122 | 2124 | | |
2123 | 2125 | | |
| |||
3056 | 3058 | | |
3057 | 3059 | | |
3058 | 3060 | | |
3059 | | - | |
| 3061 | + | |
3060 | 3062 | | |
3061 | 3063 | | |
3062 | 3064 | | |
| |||
3087 | 3089 | | |
3088 | 3090 | | |
3089 | 3091 | | |
| 3092 | + | |
3090 | 3093 | | |
3091 | 3094 | | |
3092 | 3095 | | |
| |||
3902 | 3905 | | |
3903 | 3906 | | |
3904 | 3907 | | |
| 3908 | + | |
| 3909 | + | |
3905 | 3910 | | |
3906 | 3911 | | |
3907 | 3912 | | |
| |||
3937 | 3942 | | |
3938 | 3943 | | |
3939 | 3944 | | |
3940 | | - | |
| 3945 | + | |
3941 | 3946 | | |
3942 | 3947 | | |
3943 | 3948 | | |
| |||
3995 | 4000 | | |
3996 | 4001 | | |
3997 | 4002 | | |
3998 | | - | |
| 4003 | + | |
3999 | 4004 | | |
4000 | 4005 | | |
4001 | 4006 | | |
| |||
4006 | 4011 | | |
4007 | 4012 | | |
4008 | 4013 | | |
| 4014 | + | |
| 4015 | + | |
4009 | 4016 | | |
4010 | 4017 | | |
4011 | 4018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3776 | 3776 | | |
3777 | 3777 | | |
3778 | 3778 | | |
3779 | | - | |
| 3779 | + | |
3780 | 3780 | | |
3781 | 3781 | | |
3782 | 3782 | | |
| |||
5511 | 5511 | | |
5512 | 5512 | | |
5513 | 5513 | | |
| 5514 | + | |
| 5515 | + | |
5514 | 5516 | | |
5515 | 5517 | | |
5516 | 5518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments