PHP CS Fixer & remote interpreter - inspections work when viewing file, but not when inspections/code cleanup are run from menu

I have PHP CS Fixer set up using a remote interpreter, and my `.php_cs.dist` file set as a custom ruleset in the Inspections menu

I know things are somewhat working because when I view individual files the PHP CS Fixer inspections appear as expected. If I incorrectly specify the path to the `.php_cs.dist` file then, also as expected, inspections are not shown.

However, when I try to run 'Inspect Code' or 'Code Cleanup' on those same files I get a 'No suspicous code found' balloon despite them being full of errors. A `.php_cs.cache` file is created in the same directory as `.php_cs.dist` but nothing else happens; no expected linting warnings, no expected code cleanup.

`idea.log` shows no issues - inspection started and finished a few ms later. I've tried invalidating cache but the behaviour is the same

At the moment I'm using a Docker Image configuration to work around this, but it's much more friction than having inspections and cleanup properly integrated.


Okay, just noticed this issue.

Looks like this functionality isn't supported yet.


The linked issue is most likely unrelated and you're facing another problem.

What docker image are you using and what OS?


Customised image based on php:7.4-fpm-alpine.

OS is openSUSE Tumbleweed, PhpStorm version is Build #PS-193.6015.48

I have just noticed that `.php_cs.cache` is not being generated when running inspections via the menu, it's only generated once a file has been opened and viewed, which implies PHP CS Fixer isn't running properly when an inspection's triggered from the menu, but is when triggered by viewing a file.

As both of these use the exact same configuration settings, however, I'm not sure what could account for the difference in behaviour.


Most probably, this one is related:

Basically, it is about PHP CodeSniffer and Mess Detector in batch mode in Docker but I have a strong suspicion that CS Fixer is affected as well (there are duplicating tickets about it)


Yeah, that definitely looks like the same issue, I've +1'd.

Thanks for the help!


Please sign in to leave a comment.