line_ending.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ====================
  2. Rule ``line_ending``
  3. ====================
  4. All PHP files must use same line ending.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php $b = " $a ^M
  13. - 123"; $a = <<<TEST^M
  14. -AAAAA ^M
  15. - |^M
  16. + 123"; $a = <<<TEST
  17. +AAAAA
  18. + |
  19. TEST;
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule sets:
  23. - `@PER <./../../ruleSets/PER.rst>`_
  24. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  25. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  26. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  27. - `@PSR2 <./../../ruleSets/PSR2.rst>`_
  28. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  29. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  30. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  31. References
  32. ----------
  33. - Fixer class: `PhpCsFixer\\Fixer\\Whitespace\\LineEndingFixer <./../../../src/Fixer/Whitespace/LineEndingFixer.php>`_
  34. - Test class: `PhpCsFixer\\Tests\\Fixer\\Whitespace\\LineEndingFixerTest <./../../../tests/Fixer/Whitespace/LineEndingFixerTest.php>`_
  35. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.