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
FILE: /home/morozov/Projects/phpcs-playground/test.php
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
5 | ERROR | [x] Boolean operators between conditions must be at the beginning or end of the
| | line, but not both
| | (PSR12.ControlStructures.BooleanOperatorPlacement.FoundMixed)
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
Time: 44ms; Memory: 6MB
Run phpcbf --standard=PSR12 test.php
PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE FIXED REMAINING
----------------------------------------------------------------------
/home/morozov/Projects/phpcs-playground/test.php FAILED TO FIX
----------------------------------------------------------------------
A TOTAL OF 0 ERRORS WERE FIXED IN 1 FILE
----------------------------------------------------------------------
PHPCBF FAILED TO FIX 1 FILE
----------------------------------------------------------------------
Time: 46ms; Memory: 6MB
Expected behavior
The violation is fixed.
Versions (please complete the following information):
OS: Linux
PHP: 7.4.9
PHPCS: 3.5.6
Standard: Squiz
The text was updated successfully, but these errors were encountered:
Looks to be an issue caused by the operator being the only content on the line. There is nothing to fix here as all operators are the last content on the line, so the error shouldn't be showing at all.
gsherwood
changed the title
Failed to fix a fixable PSR12.ControlStructures.BooleanOperatorPlacement.FoundMixed violation
PSR12.ControlStructures.BooleanOperatorPlacement false positive when operator is the only content on line
Sep 27, 2020
Describe the bug
A fixable rule violation is cannot be auto-fixed.
Code sample
Custom ruleset
None.
To reproduce
Steps to reproduce the behavior:
phpcs -s --standard=PSR12 test.php
phpcbf --standard=PSR12 test.php
Expected behavior
The violation is fixed.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: