Commit 63e679c
committed
Code Modernization: Replace
Since PHP 7.0 introduced the [https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op null coalescing operator], and WordPress now requires at least PHP 7.2.24, `isset( $var ) ? $var : null` ternary checks can be safely replaced with the more concise `$var ?? null` syntax.
As some new code using the null coalescing operator has already been introduced into core in recent releases, this commit continues with the code modernization by implementing incremental changes for easier review.
Follow-up to [2703], [61403].
Props dilipbheda, mukesh27, spacedmonkey, SergeyBiryukov.
Fixes #63216. See #58874.
git-svn-id: https://develop.svn.wordpress.org/trunk@61404 602fd350-edb4-49c9-b593-d223f7449a82isset() with null coalescing in WP_Roles::get_role().1 parent 3d9fde3 commit 63e679c
1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 271 | + | |
276 | 272 | | |
277 | 273 | | |
278 | 274 | | |
| |||
0 commit comments