-
Notifications
You must be signed in to change notification settings - Fork 11
Setup
Make sure to install all the prerequisites. Without them, none of this will work.
-
Based on your installation method of PHP-CS-Fixer, use one of the following settings:
Add Composer to your PATH environment variable. E.g. on Windows:
%APPDATA%\Composer\vendor\bin
. E.g. on Linux:/.composer/vendor/bin
.Add
"phpformatter.composer": true
to your VSCode user settings.
Add PHP to your PATH environment variable. I.e. ensure that
php -v
works. Otherwise use"phpformatter.phpPath" = "/path/to/php/executable"
.Point the
phpformatter.pharPath
setting to where you put the php-cs-fixer file.Not working? Make sure the
phpformatter.composer
setting is set tofalse
, which it is by default.
-
To format a file with a custom keybinding or action, see Extension Commands.
-
Done! Restart all instances of Visual Studio Code.