phpdoc_separation.rst 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. @@ -1,11 +1,12 @@
  15. <?php
  16. /**
  17. * Description.
  18. + *
  19. * @param string $foo
  20. + * @param bool $bar Bar
  21. *
  22. + * @throws Exception|RuntimeException
  23. *
  24. - * @param bool $bar Bar
  25. - * @throws Exception|RuntimeException
  26. * @return bool
  27. */
  28. function fnc($foo, $bar) {}
  29. Rule sets
  30. ---------
  31. The rule is part of the following rule sets:
  32. @PhpCsFixer
  33. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``phpdoc_separation`` rule.
  34. @Symfony
  35. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``phpdoc_separation`` rule.