require_once APP . DS . 'controllers' . DS . $this->controller . '.php';
I'm including controller. It has default value set and it always has to find something. In real world it works, but this inspection is still shinning in my IDE and I would like to solve it somehow.
Inspection says this
Path '/media/matej/space/www/rs/app/controllers/$this->controller' not found
How can I explain it, that I am aware of what is happening? Is there some comment to solve this issue?
You are using very dynamic code here .. which cannot be evaluated properly in IDE using static analysis alone (as you are using $this->controller
which can be anything during run time).
Two options here:
Suppress warning for this line only -- just place /** @noinspection PhpIncludeInspection */
on a line before that.
This option makes sense only if you have very little of such suppressions in your code, otherwise half of the file will be suppression comments :)
Just turn off such inspection completely -- adding such suppression comments all the time (often) looks ugly and not a desired way in general.
For that: Settings | Editor | Inspections | PHP | General --> Unresolved include
. It could be done for whole project or for some custom scope only.