[wp-trac] [WordPress Trac] #58948: Use Elvis operator (`:?`) to replace repeating ternary patterns (`a ? a : b`)

WordPress Trac noreply at wordpress.org
Mon Jul 31 22:47:43 UTC 2023


#58948: Use Elvis operator (`:?`) to replace repeating ternary patterns (`a ? a :
b`)
-------------------------+-------------------------------
 Reporter:  ayeshrajans  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  trunk
 Severity:  trivial      |  Resolution:
 Keywords:  has-patch    |     Focuses:  coding-standards
-------------------------+-------------------------------

Comment (by SergeyBiryukov):

 Replying to [ticket:58948 ayeshrajans]:
 > On tainted lines, it follows WordPress CS to use uppercase constants
 (`NULL` instead of `null`, for example)

 I believe the standards actually recommend lower case here, as seen on the
 PR:
 {{{
 Error: TRUE, FALSE and NULL must be lowercase; expected "null" but found
 "NULL"
 }}}

 See [19687] / #16302 for historical reference.

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


More information about the wp-trac mailing list