Most of the errors in coding standards in coder were

Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue and Squiz.Operators.ComparisonOperatorUsage.NotAllowed

I am going to attempt to fix all of these in this issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anoopjohn created an issue. See original summary.

anoopjohn’s picture

Status: Active » Needs review
FileSize
39.42 KB

Please find attached a patch to fix the issues.

Please note that the patch in #2742795: Wrong VariableAnalysis settings type in ruleset.xml should go in before this patch to be able to use phpunit to test the changes.

anoopjohn’s picture

Please find an updated patch that includes a couple of Squiz sniff errors around the same lines. This was done to prevent conflicts with the patch that fixes the Squiz related errors.

klausi’s picture

Status: Needs review » Needs work

Tests are failing with this patch. Looks like you modified the logic in VariableAnalysisSniff somewhere? This should only be a coding standards fix, not more.

anoopjohn’s picture

Status: Needs work » Needs review

Thanks for the review klausi. There was no logic changes but there were a lot of code changes. The fact that phpunit is not failing is what I have used to ensure that I was not inadvertently making logic changes.

The patch is failing because this depends on #2742795: Wrong VariableAnalysis settings type in ruleset.xml. Can you please apply that and test again. I have modified the patch in that issue based on your feedback.

  • klausi committed 33bf28f on 8.x-2.x authored by anoopjohn
    Issue #2742801 by anoopjohn: Make Coder more PHPCS coding standards...
klausi’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.