Suppress inspections using a project-wide pattern

Hi

Is there such feature?

I want to suppress unused method for any method that belongs to a class called Actions. (These methods are called dynamically depending on a url param)

Another example would be to suppress the inspection about an unused function parameter when the param is $_

These are just examples to clarify why I need such feature.

Thank you

0

Hey,

Actually, there is a feature that might help in your case.
You may want to add the whole class with all members to the “File | Settings | Editor | Inspections > PHP > Unused Symbols > Unused Declaration > Entry Points > Code Patterns”:

That should suppress the “Unused method” inspection for all methods from that class.

Does it look like what are you looking for?
 

1

This is brilliant. Thank you very much!

0

请先登录再写评论。