group_import.rst 661 B

123456789101112131415161718192021222324252627
  1. =====================
  2. Rule ``group_import``
  3. =====================
  4. There MUST be group use for the same namespaces.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -use Foo\Bar;
  14. -use Foo\Baz;
  15. +use Foo\{Bar, Baz};
  16. References
  17. ----------
  18. - Fixer class: `PhpCsFixer\\Fixer\\Import\\GroupImportFixer <./../../../src/Fixer/Import/GroupImportFixer.php>`_
  19. - Test class: `PhpCsFixer\\Tests\\Fixer\\Import\\GroupImportFixerTest <./../../../tests/Fixer/Import/GroupImportFixerTest.php>`_
  20. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.