[wp-trac] [WordPress Trac] #63430: Coding Standards: replace isset() ternary with null coalescing

WordPress Trac noreply at wordpress.org
Tue Mar 24 17:38:28 UTC 2026


#63430: Coding Standards: replace isset() ternary with null coalescing
--------------------------------------+-------------------------------
 Reporter:  seanwei                   |       Owner:  SergeyBiryukov
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  7.0
Component:  General                   |     Version:
 Severity:  minor                     |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  coding-standards
--------------------------------------+-------------------------------

Comment (by westonruter):

 In [changeset:"62107" 62107]:
 {{{
 #!CommitTicketReference repository="" revision="62107"
 Code Modernization: Fix `rest_convert_error_to_response()` handling of
 non-array error data when obtaining `status`.

 While the error data is normally an array, this is not guaranteed. This
 issue would have been detected by PHPStan rule level 9, since
 `WP_Error::get_all_error_data()` returns `mixed[]`.

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

 Follow-up to r61429.

 Props nateallen, desrosj, jorbin, mukesh27, westonruter.
 See #63430.
 Fixes #64901.
 }}}

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


More information about the wp-trac mailing list