[wp-trac] [WordPress Trac] #42885: Fix PHPCS "Yoda Condition checks" for root files of WordPress Core.
WordPress Trac
noreply at wordpress.org
Fri Jan 11 01:27:21 UTC 2019
#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.1
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses: coding-standards
-----------------------------------+-------------------------------
Comment (by jeremyfelt):
Related: the [https://make.wordpress.org/core/2018/12/18/proposed-
revisions-to-javascript-coding-standards/ proposed revisions to WP
JavaScript coding standards] include the removal of any guidance on "Yoda"
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.
I'm +1 on this.
I'm on the fence as to whether we should force non-Yoda conditions or just
let it be as long as it's not an assignment.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42885#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list