no_useless_else.rst 423 B

1234567891011121314151617181920212223242526272829303132
  1. ========================
  2. Rule ``no_useless_else``
  3. ========================
  4. There should not be useless ``else`` cases.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. if ($a) {
  14. return 1;
  15. -} else {
  16. +}
  17. return 2;
  18. -}
  19. +
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule set:
  23. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_