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

WordPress Trac noreply at wordpress.org
Wed Dec 20 01:33:28 UTC 2017


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

 * keywords:  has-patch commit => has-patch 2nd-opinion


Comment:

 I would be curious to hear about arguments in favour of allowing
 assignments in conditions.

 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.

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


More information about the wp-trac mailing list