elseif.rst 815 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. <?php
  14. if ($a) {
  15. -} else if ($b) {
  16. +} elseif ($b) {
  17. }
  18. Rule sets
  19. ---------
  20. The rule is part of the following rule sets:
  21. @PSR12
  22. Using the `@PSR12 <./../../ruleSets/PSR12.rst>`_ rule set will enable the ``elseif`` rule.
  23. @PSR2
  24. Using the `@PSR2 <./../../ruleSets/PSR2.rst>`_ rule set will enable the ``elseif`` rule.
  25. @PhpCsFixer
  26. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``elseif`` rule.
  27. @Symfony
  28. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``elseif`` rule.