[wp-meta] [Making WordPress.org] #5429: PHP Coding Standards - Yoda Conditionals - Absolute Phrasing

Making WordPress.org noreply at wordpress.org
Wed Sep 9 17:02:58 UTC 2020


#5429: PHP Coding Standards - Yoda Conditionals - Absolute Phrasing
---------------------------+---------------------
 Reporter:  sabernhardt    |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:
Component:  Developer Hub  |  Resolution:
 Keywords:                 |
---------------------------+---------------------

Comment (by sabernhardt):

 In addition to removing "always" from the first paragraph (both times),
 here are two suggestions for revising the section. If the information
 about the equal-sign operators is moved to the top, it would be
 unnecessary in the last paragraph.

 First sentence:

   When doing logical comparisons involving variables and either equality
 or identity operators (==, !=, ===, and !==), put the variable on the
 right side and put constants, literals, or function calls on the left
 side.

 Last sentence/paragraph:

   Avoid Yoda conditions for <, >, <= or >= because they are significantly
 more difficult to read.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5429#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list