PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

Generic/IncrementDecrementSpacing: handle more situations

Open jrfnl opened this issue 3 years ago • 0 comments

The Generic.WhiteSpace.IncrementDecrementSpacing sniff, so far, only handled incrementors/decrementors when they were directly before/after the variable they apply to.

This commit enhances the sniff to also allow for finding superfluous whitespace when incrementing/decrementing a property or an array item.

Includes unit tests.

Note: I've only made this change for PHP files as JS support will be dropped anyway, so it didn't feel like a good use of my time to work on that.

jrfnl avatar Jul 01 '22 14:07 jrfnl