phpdoc_order_by_value.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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>`_
  46. References
  47. ----------
  48. - Fixer class: `PhpCsFixer\\Fixer\\Phpdoc\\PhpdocOrderByValueFixer <./../../../src/Fixer/Phpdoc/PhpdocOrderByValueFixer.php>`_
  49. - Test class: `PhpCsFixer\\Tests\\Fixer\\Phpdoc\\PhpdocOrderByValueFixerTest <./../../../tests/Fixer/Phpdoc/PhpdocOrderByValueFixerTest.php>`_
  50. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.