coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

Check only for annotation with given parameter SlevomatCodingStandard.Commenting.ForbiddenAnnotations

Open MartinMystikJonas opened this issue 3 years ago • 0 comments

Hello, how hard would be extending ForbiddenAnnotations sniff to allow search for annotations not only by name by also by parameters.

I would like to find/remove all instances of @SuppressWarnings(UnusedFormalParameter) (obsolete suppress of PHPMD rule no longer used) but keep other @SuppressWarnings(something) annotations. But current implementation search only by annotation and parameters are ignored.

I checked sniff code (and AnnotationsHelper) but it is quite complex so I do not know if it would be easy to do.

MartinMystikJonas avatar Aug 19 '22 21:08 MartinMystikJonas