single_import_per_statement.rst 963 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ====================================
  2. Rule ``single_import_per_statement``
  3. ====================================
  4. There MUST be one use keyword per declaration.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. @@ -1,2 +1,4 @@
  13. <?php
  14. -use Foo, Sample, Sample\Sample as Sample2;
  15. +use Foo;
  16. +use Sample;
  17. +use Sample\Sample as Sample2;
  18. Rule sets
  19. ---------
  20. The rule is part of the following rule sets:
  21. @PSR12
  22. Using the `@PSR12 <./../../ruleSets/PSR12.rst>`_ rule set will enable the ``single_import_per_statement`` rule.
  23. @PSR2
  24. Using the `@PSR2 <./../../ruleSets/PSR2.rst>`_ rule set will enable the ``single_import_per_statement`` rule.
  25. @PhpCsFixer
  26. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``single_import_per_statement`` rule.
  27. @Symfony
  28. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``single_import_per_statement`` rule.