no_empty_statement.rst 671 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ===========================
  2. Rule ``no_empty_statement``
  3. ===========================
  4. Remove useless (semicolon) statements.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. -<?php $a = 1;;
  13. +<?php $a = 1;
  14. Example #2
  15. ~~~~~~~~~~
  16. .. code-block:: diff
  17. --- Original
  18. +++ New
  19. -<?php echo 1;2;
  20. +<?php echo 1;
  21. Example #3
  22. ~~~~~~~~~~
  23. .. code-block:: diff
  24. --- Original
  25. +++ New
  26. <?php while(foo()){
  27. - continue 1;
  28. + continue ;
  29. }
  30. Rule sets
  31. ---------
  32. The rule is part of the following rule sets:
  33. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  34. - `@Symfony <./../../ruleSets/Symfony.rst>`_