general_phpdoc_annotation_remove.rst 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. =========================================
  2. Rule ``general_phpdoc_annotation_remove``
  3. =========================================
  4. Configured annotations should be omitted from PHPDoc.
  5. Configuration
  6. -------------
  7. ``annotations``
  8. ~~~~~~~~~~~~~~~
  9. List of annotations to remove, e.g. ``["author"]``.
  10. Allowed types: ``array``
  11. Default value: ``[]``
  12. ``case_sensitive``
  13. ~~~~~~~~~~~~~~~~~~
  14. Should annotations be case sensitive.
  15. Allowed types: ``bool``
  16. Default value: ``true``
  17. Examples
  18. --------
  19. Example #1
  20. ~~~~~~~~~~
  21. With configuration: ``['annotations' => ['author']]``.
  22. .. code-block:: diff
  23. --- Original
  24. +++ New
  25. <?php
  26. /**
  27. * @internal
  28. - * @author John Doe
  29. * @AuThOr Jane Doe
  30. */
  31. function foo() {}
  32. Example #2
  33. ~~~~~~~~~~
  34. With configuration: ``['annotations' => ['author'], 'case_sensitive' => false]``.
  35. .. code-block:: diff
  36. --- Original
  37. +++ New
  38. <?php
  39. /**
  40. * @internal
  41. - * @author John Doe
  42. - * @AuThOr Jane Doe
  43. */
  44. function foo() {}
  45. Example #3
  46. ~~~~~~~~~~
  47. With configuration: ``['annotations' => ['package', 'subpackage']]``.
  48. .. code-block:: diff
  49. --- Original
  50. +++ New
  51. <?php
  52. /**
  53. * @author John Doe
  54. - * @package ACME API
  55. - * @subpackage Authorization
  56. * @version 1.0
  57. */
  58. function foo() {}