standardize_increment.rst 707 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. <?php
  13. -$i += 1;
  14. +++$i;
  15. Example #2
  16. ~~~~~~~~~~
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. <?php
  21. -$i -= 1;
  22. +--$i;
  23. Rule sets
  24. ---------
  25. The rule is part of the following rule sets:
  26. @PhpCsFixer
  27. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``standardize_increment`` rule.
  28. @Symfony
  29. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``standardize_increment`` rule.