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
The sniff doesn't check the right withespace. The following code doesn't raise an error. I would expect that there is no whitespace allowed after the minus operator.
$y = - 10 + 2;
The text was updated successfully, but these errors were encountered:
You can use the Squiz.Formatting.OperatorBracket sniff if you want to enforce this. The error message you get is No space allowed between minus sign and number.
The OperatorSpacing sniff is only concerned with arithmetic operators and specifically excludes minus signs that are used for making a number negative.
@gsherwood I come with this same issue with the following code:
$x = -1;
My ruleset in specific forbids "useless" parentheses, witch the OperatorBracket enforces them. Is there another way to fix this issue with negative numbers?
The sniff doesn't check the right withespace. The following code doesn't raise an error. I would expect that there is no whitespace allowed after the minus operator.
The text was updated successfully, but these errors were encountered: