You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP_CodeSniffer version 3.4.2 (stable) by Squiz (http://www.squiz.net)
Command:
phpcbf --standard=PSR2 test.php -p
File:
<?phpif (true) : ?>
<span></span>
<?phpendif?>
Results:
PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE FIXED REMAINING
----------------------------------------------------------------------
test.php FAILED TO FIX
----------------------------------------------------------------------
A TOTAL OF 0 ERRORS WERE FIXED IN 1 FILE
----------------------------------------------------------------------
PHPCBF FAILED TO FIX 1 FILE
----------------------------------------------------------------------
Time: 70ms; Memory: 6MB
The text was updated successfully, but these errors were encountered:
The Squiz.WhiteSpace.ScopeClosingBrace and Generic.WhiteSpace.ScopeIndent are conflicting here, due to the 5-space indent of the first line.
A quick workaround is to use a 4-space indent, which is what the sniffs are expecting when you don't specify --tab-width.
I'm not sure which sniff should be changed to resolve the conflict. It depends on if the opening PHP tag should be positioned at an exact tab stop or not.
gsherwood
changed the title
Fixer issue for Generic.WhiteSpace.ScopeIndent sniff with PSR2 standard
Generic.WhiteSpace.ScopeIndent false positives when indenting open tags at a non tab-stop
Nov 12, 2019
Thanks for reporting this. I've committed a fix, which will be in 3.5.3. With this change, the open tags will try and align as normal, meaning that the code will be fixed like this:
PHPCS version:
PHP_CodeSniffer version 3.4.2 (stable) by Squiz (http://www.squiz.net)
Command:
phpcbf --standard=PSR2 test.php -p
File:
Results:
The text was updated successfully, but these errors were encountered: