Opened 7 months ago
Closed 7 months ago
#64488 closed enhancement (fixed)
Code Modernization: replace if isset() return with null coalescing
| Reported by: | Soean | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | coding-standards |
Description (last modified by )
In #63430 isset() ternary were replaced with null coalescing.
We also should replace if isset() return with null coalescing.
<?php - if (isset($this->items[$key])) { - return $this->items[$key]; - } - - return 'fallback value'; + return $this->items[$key] ?? 'fallback value';
This is part of #58874.
Change History (7)
This ticket was mentioned in PR #10703 on WordPress/wordpress-develop by @Soean.
7 months ago
#1
- Keywords has-patch added
#2
@
7 months ago
- Summary Coding Standards: replace if isset() return with null coalescing → Code Modernization: replace if isset() return with null coalescing
- Type defect (bug) → enhancement
@westonruter commented on PR #10703:
7 months ago
#5
@Soean I found some additional opportunities in de042b59f67db0d6014be62bbe83070962ce8ad1. Take a look.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/64488