-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sniff to ensure spaces around binary operators #126
Conversation
@@ -11,7 +11,7 @@ | |||
} elseif (! $test === 0) { | |||
echo 0; | |||
} else { | |||
echo -1; | |||
echo - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a bug. It's a unary minus, should not be affected by the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see squizlabs/PHP_CodeSniffer#429.
@@ -2,7 +2,7 @@ | |||
|
|||
declare(strict_types=1); | |||
|
|||
echo -1; | |||
echo - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a bug. It's a unary minus, should not be affected by the rule.
An update on this one: we're still waiting for squizlabs/PHP_CodeSniffer#2456 which will fix the issue raised by #126 (comment). The solutions presented in squizlabs/PHP_CodeSniffer#2425, such as |
Deferred to |
This was solved via #148. |
This is a more generic sniff to the problem that we're trying to solve with #123.