[wp-trac] [WordPress Trac] #42885: Fix PHPCS "Yoda Condition checks" for root files of WordPress Core.

WordPress Trac noreply at wordpress.org
Fri Apr 13 10:13:52 UTC 2018


#42885: Fix PHPCS "Yoda Condition checks" for root files of WordPress Core.
-----------------------------------+-------------------------------
 Reporter:  chetan200891           |       Owner:  (none)
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  5.0
Component:  General                |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  coding-standards
-----------------------------------+-------------------------------

Comment (by jipmoors):

 Ultimately, the aim is to have phpcs run on every commit. If we don't
 allow assignments in conditions, then the reason for Yoda conditions
 (avoiding accidental assignment in conditions) should no longer be
 necessary.

 I disagree that it's the only reason of having that sniff.

 Having consistency on how the condition is formatted is a gain that this
 sniff provides.
 Making sure the developer does not have to think about the way it should
 be read is a big gain.

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


More information about the wp-trac mailing list