title: How to make PHP CodeSniffer standard PHPCS validate the ternary operator?
body: <p>I've been using PHP_CodeSniffer for a few days but I still can't validate some codes. When I use ternary operator, even a very simple like this:</p>
  
  <pre><code>$name = (strlen($name) &gt; 0) ? $name : 'nameless';
  </code></pre>
  
  <p>The Code Sniffer says:  </p>
  
  <blockquote>
    <p>ERROR | Inline IF statements are not allowed</p>
  </blockquote>
  
  <p>But if I write an invalid code using ternary, like this:</p>
  
  <pre><code>$name = strlen($name) &gt; 0? $name: 'nameless';
  </code></pre>
  
  <p>Code Sniffer says "FOUND 4 ERRO(S)...":</p>
  
  <blockquote>
    <p>ERROR | The value of a comparison must not be assigned to a variable
    <br>ERROR | Inline shorthand IF statement requires brackets around comparison
    <br>ERROR | Inline IF statements are not allowed
    <br>ERROR | Expected 1 space before "?"; 0 found
    <br>ERROR | Expected 1 space before ":"; 0 found</p>
  </blockquote>
  
  <p>Why it validate all ternary expressions but, when I fix all, PHPCS says it is invalid? Am I writing it wrong or it simply does not allow ternary at all?</p>