control_structure_braces.rst 716 B

123456789101112131415161718192021222324252627282930313233
  1. =================================
  2. Rule ``control_structure_braces``
  3. =================================
  4. The body of each control structure MUST be enclosed within braces.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -if (foo()) echo 'Hello!';
  14. +if (foo()) { echo 'Hello!'; }
  15. Rule sets
  16. ---------
  17. The rule is part of the following rule sets:
  18. - `@PER <./../../ruleSets/PER.rst>`_
  19. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  20. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  21. - `@PSR2 <./../../ruleSets/PSR2.rst>`_
  22. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  23. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  24. - `@Symfony <./../../ruleSets/Symfony.rst>`_