Fork me on GitHub
a Sensio Labs Product

7th Gear (v3.59.3) edition

Rule increment_style

Pre- or post-increment and decrement operators should be used if possible.



Whether to use pre- or post-increment and decrement operators.

Allowed values: 'post' and 'pre'

Default value: 'pre'


Example #1

Default configuration.

--- Original
+++ New

Example #2

With configuration: ['style' => 'post'].

--- Original
+++ New

Rule sets

The rule is part of the following rule sets:


The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.