php - PhpStorm Path not found inspection -


require_once app . ds . 'controllers' . ds . $this->controller . '.php'; 

i'm including controller. has default value set , has find something. in real world works, inspection still shinning in ide , solve somehow.

inspection says this

path '/media/matej/space/www/rs/app/controllers/$this->controller' not found 

how can explain it, aware of happening? there comment solve issue?

you using dynamic code here .. cannot evaluated in ide using static analysis alone (as using $this->controller can during run time).

two options here:

  1. suppress warning line -- place /** @noinspection phpincludeinspection */ on line before that.

    this option makes sense if have little of such suppressions in code, otherwise half of file suppression comments :)

  2. just turn off such inspection -- adding such suppression comments time (often) looks ugly , not desired way in general.

    for that: settings | editor | inspections | php | general --> unresolved include. done whole project or custom scope only.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -