phpdoc_no_useless_inheritdoc.rst 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. =====================================
  2. Rule ``phpdoc_no_useless_inheritdoc``
  3. =====================================
  4. Classy that does not inherit must not have ``@inheritdoc`` tags.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -/** {@inheritdoc} */
  14. +/** */
  15. class Sample
  16. {
  17. }
  18. Example #2
  19. ~~~~~~~~~~
  20. .. code-block:: diff
  21. --- Original
  22. +++ New
  23. <?php
  24. class Sample
  25. {
  26. /**
  27. - * @inheritdoc
  28. + *
  29. */
  30. public function Test()
  31. {
  32. }
  33. }
  34. Rule sets
  35. ---------
  36. The rule is part of the following rule sets:
  37. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  38. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  39. References
  40. ----------
  41. - Fixer class: `PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoUselessInheritdocFixer <./../../../src/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixer.php>`_
  42. - Test class: `PhpCsFixer\\Tests\\Fixer\\Phpdoc\\PhpdocNoUselessInheritdocFixerTest <./../../../tests/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixerTest.php>`_
  43. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.