The current ruleset does not handle the combined use of unary and ternary operators.

Example Code

$success ? $context['results']['success']++ : $context['results']['error']++;

Result

Fails with: "A unary operator statement must not be followed by a single space."

Comments

markdorison created an issue. See original summary.

klausi’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Status: Active » Closed (works as designed)

Coder 7.x-2.x is now frozen, this should work as expected with Coder 8.x-2.x which can also be used to check Drupal 7 code.

markdorison’s picture

Status: Closed (works as designed) » Active

@klausi I am still seeing the same result when testing with the Coder 8.x-2.x branch.

  • klausi committed 363f5ab on 8.x-2.x
    Issue #2603014: Fixed unary / ternary operator combination false...
klausi’s picture

Status: Active » Fixed

Right, committed a fix. Thanks for reporting!

Status: Fixed » Closed (fixed)

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