WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #45934, comment 14


Ignore:
Timestamp:
01/12/2019 04:55:40 AM (7 months ago)
Author:
jrf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #45934, comment 14

    initial v1  
    88
    99At the time you asked me to investigate whether there is a sniff available out there which could revert existing Yoda conditions. The answer to that is "Yes".
    10 The external [Slevomat Coding Standard](https://github.com/slevomat/coding-standard#slevomatcodingstandardcontrolstructuresdisallowyodacomparisonrequireyodacomparison-) contains a sniff which can auto-fix Yoda to non-Yoda. Tests could (should) be run to see how well it works, but this sniff could be used in a one-time action to move away from Yoda.
     10The external [https://github.com/slevomat/coding-standard#slevomatcodingstandardcontrolstructuresdisallowyodacomparisonrequireyodacomparison- Slevomat Coding Standard] contains a sniff which can auto-fix Yoda to non-Yoda. Tests could (should) be run to see how well it works, but this sniff could be used in a one-time action to move away from Yoda.
    1111Note: if the sniff would not be good enough/would turn out to be buggy, I'm happy to contribute fixes to the Slevomat standard just to make moving away from Yoda possible.
    1212