no_trailing_whitespace_in_string.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. =========================================
  2. Rule ``no_trailing_whitespace_in_string``
  3. =========================================
  4. There must be no trailing whitespace in strings.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Changing the whitespaces in strings might affect string comparisons and outputs.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. -<?php $a = '
  18. - foo
  19. +<?php $a = '
  20. + foo
  21. ';
  22. Rule sets
  23. ---------
  24. The rule is part of the following rule sets:
  25. - `@PER-CS1.0:risky <./../../ruleSets/PER-CS1.0Risky.rst>`_
  26. - `@PER-CS2.0:risky <./../../ruleSets/PER-CS2.0Risky.rst>`_
  27. - `@PER-CS:risky <./../../ruleSets/PER-CSRisky.rst>`_
  28. - `@PER:risky <./../../ruleSets/PERRisky.rst>`_
  29. - `@PSR12:risky <./../../ruleSets/PSR12Risky.rst>`_
  30. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  31. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_
  32. References
  33. ----------
  34. - Fixer class: `PhpCsFixer\\Fixer\\StringNotation\\NoTrailingWhitespaceInStringFixer <./../../../src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php>`_
  35. - Test class: `PhpCsFixer\\Tests\\Fixer\\StringNotation\\NoTrailingWhitespaceInStringFixerTest <./../../../tests/Fixer/StringNotation/NoTrailingWhitespaceInStringFixerTest.php>`_
  36. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.