
increment_style
¶Pre- or post-increment and decrement operators should be used if possible.
style
¶Whether to use pre- or post-increment and decrement operators.
Allowed values: 'post'
, 'pre'
Default value: 'pre'
With configuration: ['style' => 'post']
.
--- Original
+++ New
<?php
-++$a;
---$b;
+$a++;
+$b--;
The rule is part of the following rule sets:
Using the @PhpCsFixer rule set will enable the increment_style
rule with the default config.
Using the @Symfony rule set will enable the increment_style
rule with the default config.