How to run PHP coding standards fixer in Sublime Text 2

Step1: install package phpcs by package control

Step2: Configure phpcs.

Open setting file by Preference > Package Settings > PHP Code Sniffer > Settings - User.
Paste codes as below then replace value of phpcs_php_prefix_path and php_cs_fixer_executable_path according to your environment.

1
2
3
4
5
6
7
8
9
10
{
"phpcs_php_prefix_path": "c:/php/php.exe",
"phpcs_commands_to_php_prefix": ["Fixer"],
"php_cs_fixer_on_save": true,
"php_cs_fixer_show_quick_panel": true,
"php_cs_fixer_executable_path": "c:/php/php-cs-fixer.phar",
"php_cs_fixer_additional_args": {
"--level": "all"
}
}

###Step3: Restart sublime text and open a php file
PHP Coding Standards will run on file save.