phpdoc_to_comment.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ==========================
  2. Rule ``phpdoc_to_comment``
  3. ==========================
  4. Docblocks should only be used on structural elements.
  5. Configuration
  6. -------------
  7. ``ignored_tags``
  8. ~~~~~~~~~~~~~~~~
  9. List of ignored tags (matched case insensitively).
  10. Allowed types: ``array``
  11. Default value: ``[]``
  12. Examples
  13. --------
  14. Example #1
  15. ~~~~~~~~~~
  16. *Default* configuration.
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. <?php
  21. $first = true;// needed because by default first docblock is never fixed.
  22. -/** This should be a comment */
  23. +/* This should be a comment */
  24. foreach($connections as $key => $sqlite) {
  25. $sqlite->open($path);
  26. }
  27. Example #2
  28. ~~~~~~~~~~
  29. With configuration: ``['ignored_tags' => ['todo']]``.
  30. .. code-block:: diff
  31. --- Original
  32. +++ New
  33. <?php
  34. $first = true;// needed because by default first docblock is never fixed.
  35. -/** This should be a comment */
  36. +/* This should be a comment */
  37. foreach($connections as $key => $sqlite) {
  38. $sqlite->open($path);
  39. }
  40. /** @todo This should be a PHPDoc as the tag is on "ignored_tags" list */
  41. foreach($connections as $key => $sqlite) {
  42. $sqlite->open($path);
  43. }
  44. Rule sets
  45. ---------
  46. The rule is part of the following rule sets:
  47. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  48. - `@Symfony <./../../ruleSets/Symfony.rst>`_