single_line_comment_spacing.rst 969 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ====================================
  2. Rule ``single_line_comment_spacing``
  3. ====================================
  4. Single-line comments must have proper spacing.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -//comment 1
  14. -#comment 2
  15. -/*comment 3*/
  16. +// comment 1
  17. +# comment 2
  18. +/* comment 3 */
  19. Rule sets
  20. ---------
  21. The rule is part of the following rule sets:
  22. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  23. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  24. References
  25. ----------
  26. - Fixer class: `PhpCsFixer\\Fixer\\Comment\\SingleLineCommentSpacingFixer <./../../../src/Fixer/Comment/SingleLineCommentSpacingFixer.php>`_
  27. - Test class: `PhpCsFixer\\Tests\\Fixer\\Comment\\SingleLineCommentSpacingFixerTest <./../../../tests/Fixer/Comment/SingleLineCommentSpacingFixerTest.php>`_
  28. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.