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

CS: use combined assignment operators #416

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 24, 2020

No description provided.

@jrfnl jrfnl added this to the 1.7.1 milestone Oct 24, 2020
@ozh
Copy link
Collaborator

ozh commented Oct 24, 2020

For what it's worth, I think $i += 2; is a no brainer but find $i        += 2 + $xlen; to be confusing. The spacing and the fact that we're so used to using this notation only to increment something with an integer.

@schlessera
Copy link
Member

I don't see an immediate issue with this notation. It might be less frequently used with an additional + operator, but it will still be the more performant operation here.

I personally don't like the equal sign alignment for cases like these (I think it only makes sense in large collections of assignments, not in random code), but that is what PHPCS is currently automating. If we want to change/rediscuss this, this should be done at the WPCS ruleset level.

@schlessera schlessera merged commit 73790bc into master Nov 3, 2020
@schlessera schlessera deleted the feature/cs-use-combined-assignment-operators branch November 3, 2020 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants