[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 18:02:13 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:  performance, coding-standards
-------------------------+--------------------------------------------

Comment (by ayeshrajans):

 I wasn't aware of this before, but it looks like wpcs disallows Elvis
 operator at the moment. I will read the issues/PRs in
 https://github.com/WordPress/WordPress-Coding-Standards to see if there is
 a good reason for it, or try see if we get them allowed. PHPCS task fails
 otherwise.

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


More information about the wp-trac mailing list