standardize_increment.rst 682 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ==============================
  2. Rule ``standardize_increment``
  3. ==============================
  4. Increment and decrement operators should be used if possible.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. @@ -1,2 +1,2 @@
  13. <?php
  14. -$i += 1;
  15. +++$i;
  16. Example #2
  17. ~~~~~~~~~~
  18. .. code-block:: diff
  19. --- Original
  20. +++ New
  21. @@ -1,2 +1,2 @@
  22. <?php
  23. -$i -= 1;
  24. +--$i;
  25. Rule sets
  26. ---------
  27. The rule is part of the following rule sets:
  28. @Symfony
  29. Using the ``@Symfony`` rule set will enable the ``standardize_increment`` rule.
  30. @PhpCsFixer
  31. Using the ``@PhpCsFixer`` rule set will enable the ``standardize_increment`` rule.