-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #2640 made it so the `Squiz.WhiteSpace.OperatorSpacing` sniff now sets a property with the `$nonOperandTokens` from the `register()` method. However, the PSR12 sniff for the same extends the Squiz sniff, but overloads the `register()` method to set different targets. This means that the `$nonOperandTokens` array was empty and therefore the `isOperator()` method would nearly always return `true`, which was often incorrect. Fixed by calling the `parent::register()` method before setting the `$targets` for the PSR12 sniff. Includes adding unit tests to the PSR12 sniff related to the exclusions handled via the `isOperator()` method, to prevent breakage like this from being able to be merged in the future.
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters