sublime 安装phpcs

52 篇文章 0 订阅

我这边是用的 sulime 2

直接ctrl+shift+p 输入 install package 敲击回车。输入phpcs 回车开始安装操作。

安装完成后需要进行 phpcs配置 

{
 
// Path to php on windows installation
// This is needed as we cannot run phars on windows, so we run it through php
"phpcs_php_prefix_path": "D:\\phpStudy\\php55n\\php.exe",
 
// This is the path to the bat file when we installed PHP_CodeSniffer
"phpcs_executable_path": "D:\\phpStudy\\php55n\\phpcs.bat",
 
// PHP-CS-Fixer settings
// Don't want to auto fix issue with php-cs-fixer
"php_cs_fixer_on_save": false,
 
// Show the quick panel
"php_cs_fixer_show_quick_panel": true,
 
// The fixer phar file is stored here:
"php_cs_fixer_executable_path": "D:\\phpStudy\\php55n\\php-cs-fixer.phar",
 
// PHP Linter settings
// Yes, lets lint the files
"phpcs_linter_run": true,
 
// And execute that on each file when saved (php only as per extensions_to_execute)
"phpcs_linter_command_on_save": true,
 
// Path to php
"phpcs_php_path": "D:\\phpStudy\\php55n\\php.exe",
 
// This is the regex format of the errors
"phpcs_linter_regex": "(?P<message>.*) on line (?P<line>\\d+)",
 
 
// PHP Mess Detector settings
// Not turning on the mess detector here
"phpmd_run": false,
"phpmd_command_on_save": false,
"phpmd_executable_path": "",
"phpmd_additional_args": {}
}
配置完成后。重新打开 sublimt ide 即可。


php-cs-fixer.phar
phpcs.bat

这些文件安装 php_codesniffer 即可得到。

http://pear.php.net/package/PHP_CodeSniffer/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一名路过的小码农

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值