empty_loop_body.rst 827 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ========================
  2. Rule ``empty_loop_body``
  3. ========================
  4. Empty loop-body must be in configured style.
  5. Configuration
  6. -------------
  7. ``style``
  8. ~~~~~~~~~
  9. Style of empty loop-bodies.
  10. Allowed values: ``'braces'`` and ``'semicolon'``
  11. Default value: ``'semicolon'``
  12. Examples
  13. --------
  14. Example #1
  15. ~~~~~~~~~~
  16. *Default* configuration.
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. -<?php while(foo()){}
  21. +<?php while(foo());
  22. Example #2
  23. ~~~~~~~~~~
  24. With configuration: ``['style' => 'braces']``.
  25. .. code-block:: diff
  26. --- Original
  27. +++ New
  28. -<?php while(foo());
  29. +<?php while(foo()){}
  30. Rule sets
  31. ---------
  32. The rule is part of the following rule sets:
  33. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  34. - `@Symfony <./../../ruleSets/Symfony.rst>`_ with config:
  35. ``['style' => 'braces']``