Closed
Description
<?php
$c = $argv[1] ?: "";
$filepath = realpath($argv[1]) ?: $argv[1];
Line 3 triggers both Squiz.ControlStructures.InlineIfDeclaration.SpacingAfterThen & SpacingBeforeElse
Line 2 also uses "?:" but is fine
phpcs /tmp/s.php -s
phpcs /tmp/s.php -s
FILE: /tmp/s.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | Inline shorthand IF statement requires 1 space after THEN; 0 found (Squiz.ControlStructures.InlineIfDeclaration.SpacingAfterThen)
3 | ERROR | Inline shorthand IF statement requires 1 space before ELSE; 0 found (Squiz.ControlStructures.InlineIfDeclaration.SpacingBeforeElse)
-------------------------------------------------------------------------------------------------------------------------------------------------