2015年4月12日 星期日

sublime安裝phpcs windows版

1.安裝sublime並安裝好package control

2.安裝phpcs

3.打開command並利用composer安裝 PHP_CodeSniffer PHP-CS-Fixer PHPMD

composer global require squizlabs/php_codesniffer fabpot/php-cs-fixer phpmd/phpmd

4.將PHP Code Sniffer => Settings - Default的內容複製到 PHP Code Sniffer => Settings - User

5.修改Settings - User

{
    "phpcs_executable_path": "phpcs.bat",
    "php_cs_fixer_on_save": true,
    "php_cs_fixer_executable_path": "php-cs-fixer.bat",
    "phpcbf_on_save": true,
    "phpcbf_executable_path": "phpcbf.bat",
    "phpmd_run": true,
    "phpmd_executable_path": "phpmd.bat"
}

如果進行存檔時還是會提示錯誤訊息修改下列參數即可

{
    "phpcs_php_prefix_path": "php路徑\\php.exe"
}

參考 wamp安裝 composer安裝

沒有留言:

張貼留言