phpdoc_order_by_value.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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', 'mixin', '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. <?php
  21. /**
  22. + * @covers Bar
  23. * @covers Foo
  24. - * @covers Bar
  25. */
  26. final class MyTest extends \PHPUnit_Framework_TestCase
  27. {}
  28. Example #2
  29. ~~~~~~~~~~
  30. With configuration: ``['annotations' => ['author']]``.
  31. .. code-block:: diff
  32. --- Original
  33. +++ New
  34. <?php
  35. /**
  36. + * @author Alice
  37. * @author Bob
  38. - * @author Alice
  39. */
  40. final class MyTest extends \PHPUnit_Framework_TestCase
  41. {}
  42. Rule sets
  43. ---------
  44. The rule is part of the following rule set:
  45. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_