PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

Checking the conversion of some expressions to combined assignments

Open elfring opened this issue 4 years ago • 1 comments

The PHP programming language supports also the usage of combined operators. :thought_balloon: I propose to search for places where variable names can be replaced by combined assignments. How do you think about to offer corresponding source code analyses and transformations? :thinking:

elfring avatar Nov 18 '21 16:11 elfring

While none of the standards included with PHPCS contains such a sniff, you may be interested to hear that the external Slevomat standard does: SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator

jrfnl avatar Nov 18 '21 16:11 jrfnl