single_blank_line_at_eof.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. =================================
  2. Rule ``single_blank_line_at_eof``
  3. =================================
  4. A PHP file without end tag must always end with a single empty line feed.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -$a = 1;
  14. \ No newline at end of file
  15. +$a = 1;
  16. Example #2
  17. ~~~~~~~~~~
  18. .. code-block:: diff
  19. --- Original
  20. +++ New
  21. <?php
  22. $a = 1;
  23. -
  24. Rule sets
  25. ---------
  26. The rule is part of the following rule sets:
  27. - `@PER <./../../ruleSets/PER.rst>`_
  28. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  29. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  30. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  31. - `@PSR2 <./../../ruleSets/PSR2.rst>`_
  32. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  33. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  34. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  35. References
  36. ----------
  37. - Fixer class: `PhpCsFixer\\Fixer\\Whitespace\\SingleBlankLineAtEofFixer <./../../../src/Fixer/Whitespace/SingleBlankLineAtEofFixer.php>`_
  38. - Test class: `PhpCsFixer\\Tests\\Fixer\\Whitespace\\SingleBlankLineAtEofFixerTest <./../../../tests/Fixer/Whitespace/SingleBlankLineAtEofFixerTest.php>`_
  39. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.