no_trailing_whitespace_in_comment.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ==========================================
  2. Rule ``no_trailing_whitespace_in_comment``
  3. ==========================================
  4. There MUST be no trailing spaces inside comment or PHPDoc.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -// This is
  14. -// a comment.
  15. +// This is
  16. +// a comment.
  17. Rule sets
  18. ---------
  19. The rule is part of the following rule sets:
  20. - `@PER <./../../ruleSets/PER.rst>`_
  21. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  22. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  23. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  24. - `@PSR2 <./../../ruleSets/PSR2.rst>`_
  25. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  26. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  27. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  28. References
  29. ----------
  30. - Fixer class: `PhpCsFixer\\Fixer\\Comment\\NoTrailingWhitespaceInCommentFixer <./../../../src/Fixer/Comment/NoTrailingWhitespaceInCommentFixer.php>`_
  31. - Test class: `PhpCsFixer\\Tests\\Fixer\\Comment\\NoTrailingWhitespaceInCommentFixerTest <./../../../tests/Fixer/Comment/NoTrailingWhitespaceInCommentFixerTest.php>`_
  32. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.