single_blank_line_before_namespace.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ===========================================
  2. Rule ``single_blank_line_before_namespace``
  3. ===========================================
  4. There should be exactly one blank line before a namespace declaration.
  5. Warning
  6. -------
  7. This rule is deprecated and will be removed in the next major version
  8. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. You should use ``blank_lines_before_namespace`` instead.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. -<?php namespace A {}
  18. +<?php
  19. +
  20. +namespace A {}
  21. Example #2
  22. ~~~~~~~~~~
  23. .. code-block:: diff
  24. --- Original
  25. +++ New
  26. <?php
  27. -
  28. namespace A{}
  29. References
  30. ----------
  31. - Fixer class: `PhpCsFixer\\Fixer\\NamespaceNotation\\SingleBlankLineBeforeNamespaceFixer <./../../../src/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixer.php>`_
  32. - Test class: `PhpCsFixer\\Tests\\Fixer\\NamespaceNotation\\SingleBlankLineBeforeNamespaceFixerTest <./../../../tests/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixerTest.php>`_
  33. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.