Supressing an inspection for all occurances of a name

I have this class "SolutionConfig" which is not part of the project, but does appear on the production system. It's used rather a lot in the code, but because of it's absence from the project, I'm getting yellow everywhere ("Undefined class"). Rather than put a @noinspection tag on every usage, is it possible to just suppress the inspection for this one name everywhere in the project. If not for the entire project, how about each file at least?

4 comments
Comment actions Permalink

Hi there,

Why don't you create a stub file for that class and place it anywhere in you project (and exclude from deployment) -- it will never be used by actual code during execution -- it's for IDE only.

A stub file here means a .php file with that class declared + whatever methods/properties you will be using -- just leave the implementation bodies empty. That's how all standard (known to PhpStorm) classes are done anyway -- just Ctrl+Click (Navigate to declaration/definition) and see for yourself.

0
Comment actions Permalink

Because that would involve making changes to the project that I am not confident will be safe. If there's no other way to do it, then that's probably what I'll do, but I'd rather just tell PS not to worry about any class called "SolutionConfig".

0
Comment actions Permalink

What "changes to the project" are you talking about?

If that's about placing a stub file into the project .. then just place it elsewhere and reference in any other supported way (Additional Content Root or via Include Paths functionality).

0
Comment actions Permalink

I guess I could do it that way. 'Wouldn't be able to put it in the repo though.

0

Please sign in to leave a comment.