Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

carusogabriel
Copy link
Contributor

This is a more generic sniff to the problem that we're trying to solve with #123.

@carusogabriel carusogabriel added this to the 7.0.0 milestone May 22, 2019
@carusogabriel carusogabriel requested a review from a team as a code owner May 22, 2019 13:57
@carusogabriel carusogabriel self-assigned this May 22, 2019
@@ -11,7 +11,7 @@
} elseif (! $test === 0) {
echo 0;
} else {
echo -1;
echo - 1;
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -2,7 +2,7 @@

declare(strict_types=1);

echo -1;
echo - 1;
Copy link
Member

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.

@carusogabriel
Copy link
Contributor Author

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 PSR12.Operators.OperatorSpacing does not help us :(

@Ocramius Ocramius modified the milestones: 7.0.0, 8.0.0 Dec 9, 2019
@Ocramius
Copy link
Member

Ocramius commented Dec 9, 2019

Deferred to 8.0.0

@carusogabriel carusogabriel removed this from the 8.0.0 milestone Dec 18, 2019
@carusogabriel
Copy link
Contributor Author

This was solved via #148.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants