Can't make PHP-CS-Fixer work
Hi,
I can't make PHP-CS-Fixer to work with PhpStorm properly, it can detect unrespected rules but it won't fix them automatically neither manually ...
My configuration is PhpStorm 2018.3 on Windows 10 PRO with Windows Subsystem for Linux (Ubuntu) for my terminal (on which composer is installed).
I've installed php-cs-fixer locally in my project :

If i try to fix my code through my terminal it works :

I tried to configure it with my docker PHP interpreter in PhpStorm like this :

Everything seems working so far, i've enabled it with default PSR-2 rules to try :

When i open a PHP file, it does detect unrespected rules but it doesn't fix anything (not even manually with alt+enter) :

First time i tried it, i've seen a timeout exceed error, so as you can see in my previous screenshot i raised it to 30 seconds, now i have no messages, but nothing happen.
Note : that i'm using a docker CLI interpreter for PHP-CS-Fixer, because i don't have php-cs-fixer.bat as i have no Composer or PHP installed on Windows (everything is set in my WSL), yes my environment is specific but i like it like this :)
Any ideas ?
Thanks in advance.
请先登录再写评论。
Fixing the code using remote interpreters isn't supported yet unfortunately: https://youtrack.jetbrains.com/issue/WI-43121
Thanks for clarifying that !
I was struggling with it the whole day, i think this issue should be noticed in the official documentation as it clearly shows remote interpreter as a valid option : https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html#installing-configuring-php-cs-fixer
I found a temporary solution in my case, if anybody is interested in, follow these steps :
This way i don't have to install PHP/Composer on Windows, the downside is that i'm not using php-cs-fixer installed in my project.
Running into the same issue here - but not quite sure how to create this .bat file - anything you can share xavier?
Sure, Here's my commented .bat file, hope it'll help you :
:: Prerequisties
:: - WSL (Windows Subsystem for Linux) with Composer installed
:: The whole project path folder MUST NOT have spaces
@echo off
:: CONFIGURATION
:: Windows Disk letter of the Windows location
:: Important : WLS need to be configured with the symlink of this letter
set WindowsDiskLetter=C
:: Windows Disk letter of the project location
:: Important : WLS need to be configured with the symlink of this letter
set ProjectDiskLetter=D
:: CONFIGURATION
:: Get command arguments
set "Arg=%*"
:: Replace backslashes with forward slashes
set Arg=%Arg:\=/%
:: Set absolute path (C:/ -> /C/)
call set Arg=%%Arg:%WindowsDiskLetter%:/=/%WindowsDiskLetter%/%%
:: Set absolute path (D:/ -> /D/)
call set Arg=%%Arg:%ProjectDiskLetter%:/=/%ProjectDiskLetter%/%%
:: Execute composer from WSL Ubuntu with PhpStorm arguments
"ubuntu" -c "php-cs-fixer %Arg%"
:: Setting up composer in IDE
:: Settings > Languages & Frameworks > PHP > Quality Tools > Local Configuration
:: Insert /path/to/your/php-cs-fixer.bat