no_superfluous_elseif.rst 456 B

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