blank_line_after_namespace.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ===================================
  2. Rule ``blank_line_after_namespace``
  3. ===================================
  4. There MUST be one blank line after the namespace declaration.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. namespace Sample\Sample;
  14. -
  15. $a;
  16. Example #2
  17. ~~~~~~~~~~
  18. .. code-block:: diff
  19. --- Original
  20. +++ New
  21. <?php
  22. namespace Sample\Sample;
  23. +
  24. Class Test{}
  25. Rule sets
  26. ---------
  27. The rule is part of the following rule sets:
  28. - `@PER <./../../ruleSets/PER.rst>`_
  29. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  30. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  31. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  32. - `@PSR2 <./../../ruleSets/PSR2.rst>`_
  33. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  34. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  35. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  36. References
  37. ----------
  38. - Fixer class: `PhpCsFixer\\Fixer\\NamespaceNotation\\BlankLineAfterNamespaceFixer <./../../../src/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixer.php>`_
  39. - Test class: `PhpCsFixer\\Tests\\Fixer\\NamespaceNotation\\BlankLineAfterNamespaceFixerTest <./../../../tests/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixerTest.php>`_
  40. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.