composer global require friendsofphp/php-cs-fixer
after successfully installation of PHP-CS-FIXER
now install PHP-CS-FIXER VSCODE Extension
in VSCODE User Settings
press Ctrl+, to get VSCODE User Settings
"php-cs-fixer.executablePath": "php-cs-fixer.bat",
"php-cs-fixer.executablePathWindows": "php-cs-fixer.bat",
"php-cs-fixer.onsave": true,
//If you want to create a custom config for php-cs-fixer
//create a .php_cs file in this C:\Users\username\.vscode directory
"php-cs-fixer.config": "C:\\Users\\username\\.vscode\\.php_cs",
That's all! Hope this will help you!
I extracted both php and php-cs-fixer on the same folder without installing composer.
I then added this lines to my config file and php-cs-fixer is working:
"php.validate.executablePath": "C:\Users\jaime\php-7.2.7-Win32-VC15-x64\php.exe",
"php.executablePath": "C:\Users\jaime\php-7.2.7-Win32-VC15-x64\php.exe",
"php-cs-fixer.executablePath": "C:\Users\jaime\php-7.2.7-Win32-VC15-x64\php-cs-fixer-v2.phar",
"php-cs-fixer.executablePathWindows": "C:\Users\jaime\php-7.2.7-Win32-VC15-x64\php-cs-fixer-v2.phar",