-
-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
spaze/coding-standard
#27Labels
Description
I have a method that contains only this body (for testing):
private function foo(): bool
{
~(1 - 1);
}PHPCS reports the following on ~(1 - 1);:
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Useless parentheses. (SlevomatCodingStandard.PHP.UselessParentheses.UselessParentheses)
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------
Running phpcbf then removes the outer parentheses so that the method body reads
~1 - 1;But those two lines don't give the same result:
> ~(1 - 1);
= -1
> ~1 - 1;
= -3Using slevomat/coding-standard 8.18.0, phpcs 3.13.0.