phpdoc_order_by_value.rst 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ==============================
  2. Rule ``phpdoc_order_by_value``
  3. ==============================
  4. Order phpdoc tags by value.
  5. Configuration
  6. -------------
  7. ``annotations``
  8. ~~~~~~~~~~~~~~~
  9. List of annotations to order, e.g. ``["covers"]``.
  10. Allowed values: a subset of ``['author', 'covers', 'coversNothing', 'dataProvider', 'depends', 'group', 'internal', 'method', 'property', 'property-read', 'property-write', 'requires', 'throws', 'uses']``
  11. Default value: ``['covers']``
  12. Examples
  13. --------
  14. Example #1
  15. ~~~~~~~~~~
  16. *Default* configuration.
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. @@ -1,7 +1,7 @@
  21. <?php
  22. /**
  23. + * @covers Bar
  24. * @covers Foo
  25. - * @covers Bar
  26. */
  27. final class MyTest extends \PHPUnit_Framework_TestCase
  28. {}
  29. Example #2
  30. ~~~~~~~~~~
  31. With configuration: ``['annotations' => ['author']]``.
  32. .. code-block:: diff
  33. --- Original
  34. +++ New
  35. @@ -1,7 +1,7 @@
  36. <?php
  37. /**
  38. + * @author Alice
  39. * @author Bob
  40. - * @author Alice
  41. */
  42. final class MyTest extends \PHPUnit_Framework_TestCase
  43. {}
  44. Rule sets
  45. ---------
  46. The rule is part of the following rule set:
  47. @PhpCsFixer
  48. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``phpdoc_order_by_value`` rule with the default config.