blank_line_between_import_groups.rst 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. =========================================
  2. Rule ``blank_line_between_import_groups``
  3. =========================================
  4. Putting blank lines between ``use`` statement groups.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. use function AAC;
  14. +
  15. use const AAB;
  16. +
  17. use AAA;
  18. Example #2
  19. ~~~~~~~~~~
  20. .. code-block:: diff
  21. --- Original
  22. +++ New
  23. <?php
  24. use const AAAA;
  25. use const BBB;
  26. +
  27. use Bar;
  28. use AAC;
  29. use Acme;
  30. +
  31. use function CCC\AA;
  32. use function DDD;
  33. Example #3
  34. ~~~~~~~~~~
  35. .. code-block:: diff
  36. --- Original
  37. +++ New
  38. <?php
  39. use const BBB;
  40. use const AAAA;
  41. +
  42. use Acme;
  43. use AAC;
  44. use Bar;
  45. +
  46. use function DDD;
  47. use function CCC\AA;
  48. Example #4
  49. ~~~~~~~~~~
  50. .. code-block:: diff
  51. --- Original
  52. +++ New
  53. <?php
  54. use const AAAA;
  55. use const BBB;
  56. +
  57. use Acme;
  58. +
  59. use function DDD;
  60. +
  61. use AAC;
  62. +
  63. use function CCC\AA;
  64. +
  65. use Bar;
  66. Rule sets
  67. ---------
  68. The rule is part of the following rule sets:
  69. - `@PER <./../../ruleSets/PER.rst>`_
  70. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  71. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  72. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  73. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  74. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  75. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  76. References
  77. ----------
  78. - Fixer class: `PhpCsFixer\\Fixer\\Whitespace\\BlankLineBetweenImportGroupsFixer <./../../../src/Fixer/Whitespace/BlankLineBetweenImportGroupsFixer.php>`_
  79. - Test class: `PhpCsFixer\\Tests\\Fixer\\Whitespace\\BlankLineBetweenImportGroupsFixerTest <./../../../tests/Fixer/Whitespace/BlankLineBetweenImportGroupsFixerTest.php>`_
  80. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.