phpdoc_separation.rst 966 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ==========================
  2. Rule ``phpdoc_separation``
  3. ==========================
  4. Annotations in PHPDoc should be grouped together so that annotations of the same
  5. type immediately follow each other, and annotations of a different type are
  6. separated by a single blank line.
  7. Examples
  8. --------
  9. Example #1
  10. ~~~~~~~~~~
  11. .. code-block:: diff
  12. --- Original
  13. +++ New
  14. <?php
  15. /**
  16. * Description.
  17. + *
  18. * @param string $foo
  19. + * @param bool $bar Bar
  20. *
  21. + * @throws Exception|RuntimeException
  22. *
  23. - * @param bool $bar Bar
  24. - * @throws Exception|RuntimeException
  25. * @return bool
  26. */
  27. function fnc($foo, $bar) {}
  28. Rule sets
  29. ---------
  30. The rule is part of the following rule sets:
  31. @PhpCsFixer
  32. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``phpdoc_separation`` rule.
  33. @Symfony
  34. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``phpdoc_separation`` rule.