I see similar posts to my issue, some with responses suggesting suppressing warnings (and some people saying they don't want to), some suggesting using Resource root. My problem is not the same as the person who wanted inspections to allow for files that have a section of code started in one file and finished in another. But it's similar in that if the inspection was able to evaluate file references from the perspective of the file doing the include there wouldn't be an issue.
I started off with code in a PHP file that was intended to be rendered. Then moved chunks of code into include files. The included files generate warnings for statements referencing files whose location did not cause a problem when the code sections were in the original file.
The directory structure is like this:
Root (on the web, not the project root)
---------- header.php (with section moved from public/staff/index.php
--------------- index.php (this is the file that will be accessed)
----------------stylesheet.css (referenced in includes)
It seems to me that my choices include the following:
- Write code in the file that will be accessed, and only move if after inspection and testing.
- Write the code in the include file, suppress warnings for the file, and test with Xdebug.
Am I missing a better way to configure and use PhpStorm? Suppressing warnings for the include function doesn't seem like a great idea.