string_line_ending.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ===========================
  2. Rule ``string_line_ending``
  3. ===========================
  4. All multi-line strings must use correct line ending.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Changing the line endings of multi-line strings might affect string comparisons
  10. and outputs.
  11. Examples
  12. --------
  13. Example #1
  14. ~~~~~~~~~~
  15. .. code-block:: diff
  16. --- Original
  17. +++ New
  18. -<?php $a = 'my^M
  19. +<?php $a = 'my
  20. multi
  21. -line^M
  22. +line
  23. string';^M
  24. Rule sets
  25. ---------
  26. The rule is part of the following rule sets:
  27. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  28. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_
  29. References
  30. ----------
  31. - Fixer class: `PhpCsFixer\\Fixer\\StringNotation\\StringLineEndingFixer <./../../../src/Fixer/StringNotation/StringLineEndingFixer.php>`_
  32. - Test class: `PhpCsFixer\\Tests\\Fixer\\StringNotation\\StringLineEndingFixerTest <./../../../tests/Fixer/StringNotation/StringLineEndingFixerTest.php>`_
  33. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.