ordered_traits.rst 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. =======================
  2. Rule ``ordered_traits``
  3. =======================
  4. Trait ``use`` statements must be sorted alphabetically.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Risky when depending on order of the imports.
  10. Configuration
  11. -------------
  12. ``case_sensitive``
  13. ~~~~~~~~~~~~~~~~~~
  14. Whether the sorting should be case sensitive.
  15. Allowed types: ``bool``
  16. Default value: ``false``
  17. Examples
  18. --------
  19. Example #1
  20. ~~~~~~~~~~
  21. *Default* configuration.
  22. .. code-block:: diff
  23. --- Original
  24. +++ New
  25. <?php class Foo {
  26. -use Z; use A; }
  27. +use A; use Z; }
  28. Example #2
  29. ~~~~~~~~~~
  30. With configuration: ``['case_sensitive' => true]``.
  31. .. code-block:: diff
  32. --- Original
  33. +++ New
  34. <?php class Foo {
  35. -use Aaa; use AA; }
  36. +use AA; use Aaa; }
  37. Rule sets
  38. ---------
  39. The rule is part of the following rule sets:
  40. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  41. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_