PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

Generic.WhiteSpace.SpaceIndent.IncorrectExact false positive when condition or cycle are placed inside the block

Open pincher2012 opened this issue 4 years ago • 0 comments

Describe the bug Generic.WhiteSpace.SpaceIndent.IncorrectExact false positive when condition or cycle are placed inside the block

Code sample

{
    if (1 > 2) {
        $a = 1;
    }

}

Shows

--------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
 3 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
 5 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

Expected behavior Sniff doesn't fire

Versions (please complete the following information):

  • PHPCS: [master]

pincher2012 avatar Jan 03 '22 00:01 pincher2012