elseif.rst 834 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ===============
  2. Rule ``elseif``
  3. ===============
  4. The keyword ``elseif`` should be used instead of ``else if`` so that all control
  5. keywords look like single words.
  6. Examples
  7. --------
  8. Example #1
  9. ~~~~~~~~~~
  10. .. code-block:: diff
  11. --- Original
  12. +++ New
  13. @@ -1,4 +1,4 @@
  14. <?php
  15. if ($a) {
  16. -} else if ($b) {
  17. +} elseif ($b) {
  18. }
  19. Rule sets
  20. ---------
  21. The rule is part of the following rule sets:
  22. @PSR12
  23. Using the `@PSR12 <./../../ruleSets/PSR12.rst>`_ rule set will enable the ``elseif`` rule.
  24. @PSR2
  25. Using the `@PSR2 <./../../ruleSets/PSR2.rst>`_ rule set will enable the ``elseif`` rule.
  26. @PhpCsFixer
  27. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``elseif`` rule.
  28. @Symfony
  29. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``elseif`` rule.