I am developing a web application using PhpStorm on OSx. I'm using Composer and have PSR-4 autoloading configured in composer.json
. Everything is working fine on my development machine, but autoloading breaks when I upload to the production server which runs Linux.
After some troubleshooting it turns out that it's because OSx is using a case insensitive file system, while Linux is using a case sensitive one. And since my namespaces look like this
App\Service\AuthService
while my paths look like this
app/service/AuthService.php
the autoloader can't find the service
folder on Linux, because it's looking for Service
(with a capital S
).
Okay, so I can fix this easily enough by just renaming all folders and class files to use the same cases as my namespaces. But in order to prevent any accidental case inconsistencies in the future, it would be nice if PhpStorm would warn me when I try to use
use App/Foo/Bar/HelloWorld;
while the actual file path is
app/foo/bar/HelloWorld.php
Is there such a setting I can use to have PhpStorm check this automatically, even when I'm developing on a machine with a case insensitive file system?