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
Describe the bug
Using "-" or "+" to force an string to a numeric value, sometimes triggers PSR12.Operators.OperatorSpacing.NoSpaceAfter.
In the exemple bellow it's triggered on the concatination rows, but not the other 2 rows.
Create a file called test.php with the code sample above...
Run phpcs --standard=PSR12 test.php
See error message displayed
FILE: /..../test.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
6 | ERROR | [x] Expected at least 1 space after "+"; 0 found
7 | ERROR | [x] Expected at least 1 space after "-"; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Expected behavior
consistent.
Trigger on zero or all four of the rows,
I myself prefer if zero of the above rows trigger.
Versions (please complete the following information):
The added test seams to only regard the "-" version, but I assume the fix also fixes the "+" version.
Maybe there should be test for the "+" version too.
Describe the bug
Using "-" or "+" to force an string to a numeric value, sometimes triggers PSR12.Operators.OperatorSpacing.NoSpaceAfter.
In the exemple bellow it's triggered on the concatination rows, but not the other 2 rows.
Code sample
Custom ruleset
--standard=PSR12
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs --standard=PSR12 test.php
Expected behavior
consistent.
Trigger on zero or all four of the rows,
I myself prefer if zero of the above rows trigger.
Versions (please complete the following information):
Additional context
Looks related to #2696
The text was updated successfully, but these errors were encountered: