phpdoc_param_order.rst 859 B

123456789101112131415161718192021222324252627282930313233
  1. ===========================
  2. Rule ``phpdoc_param_order``
  3. ===========================
  4. Orders all ``@param`` annotations in DocBlocks according to method signature.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. /**
  14. * Annotations in wrong order
  15. *
  16. * @param int $a
  17. + * @param array $b
  18. * @param Foo $c
  19. - * @param array $b
  20. */
  21. function m($a, array $b, Foo $c) {}
  22. References
  23. ----------
  24. - Fixer class: `PhpCsFixer\\Fixer\\Phpdoc\\PhpdocParamOrderFixer <./../../../src/Fixer/Phpdoc/PhpdocParamOrderFixer.php>`_
  25. - Test class: `PhpCsFixer\\Tests\\Fixer\\Phpdoc\\PhpdocParamOrderFixerTest <./../../../tests/Fixer/Phpdoc/PhpdocParamOrderFixerTest.php>`_
  26. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.