Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Feb 5, 2019

As discussed in #2387, there are dedicated sniffs for checking the spacing around assignment operators:

  • PSR12.Operators.OperatorSpacing
  • Squiz.WhiteSpace.OperatorSpacing

Both of these are more comprehensive and more appropriate to use than the limited assignment operator spacing check in this sniff.

Removing the assignment operator spacing checks from this sniff, lowers the risk of fixer conflicts regarding operator spacing and gets rid of duplicate notices in the PSR12 and Squiz standard and inappropriate notices for the PEAR, PSR2 and Zend standard.

Includes adjusted unit tests.

…ng checks

As discussed in 2387, there are dedicated sniffs for checking the spacing around assignment operators:
* `PSR12.Operators.OperatorSpacing`
* `Squiz.WhiteSpace.OperatorSpacing`

Both of these are more comprehensive and more appropriate to use than the limited assignment operator spacing check in this sniff.

Removing the assignment operator spacing checks from this sniff, lowers the risk of fixer conflicts regarding operator spacing and gets rid of duplicate notices in the `PSR12` and `Squiz` standard and inappropriate notices for the `PEAR`, `PSR2` and `Zend` standard.

Includes adjusted unit tests.
@sertand
Copy link
Member

sertand commented May 23, 2019

Thanks for the patch.

@gsherwood
Copy link
Member

An unintended benefit of this change was that the PEAR, PSR2, and PSR12 standard are no longer checking assignment operators inside function calls. They should never have been doing this, but the Squiz standard was, and so they inherited it.

@jrfnl jrfnl deleted the feature/generic-functioncallargumentspacing-remove-equal-sign-checks branch May 23, 2019 11:15
rodrigoprimo added a commit to rodrigoprimo/PHP_CodeSniffer that referenced this pull request Apr 2, 2025
…out spacing around equal sign

The FunctionCallArgumentSpacing sniff used to check for spacing around
the equal sign in the arguments of a function declaration. But this was
removed in squizlabs/PHP_CodeSniffer#2399
(commit feeda47).

This commit updates the sniff XML doc to reflect this change.
jrfnl pushed a commit to rodrigoprimo/PHP_CodeSniffer that referenced this pull request Apr 3, 2025
…out spacing around equal sign

The FunctionCallArgumentSpacing sniff used to check for spacing around
the equal sign in the arguments of a function declaration. But this was
removed in squizlabs/PHP_CodeSniffer#2399
(commit feeda47).

This commit updates the sniff XML doc to reflect this change.
jrfnl pushed a commit to PHPCSStandards/PHP_CodeSniffer that referenced this pull request Apr 3, 2025
…out spacing around equal sign

The FunctionCallArgumentSpacing sniff used to check for spacing around
the equal sign in the arguments of a function declaration. But this was
removed in squizlabs/PHP_CodeSniffer#2399
(commit feeda47).

This commit updates the sniff XML doc to reflect this change.
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