sublime text 3 phpcs
来源:互联网 发布:php 整数变小数 编辑:程序博客网 时间:2024/06/05 21:42
这里写链接内容
第一步:下载php code sniffer插件安装包 地址 https://github.com/benmatselby/sublime-phpcs;
解压安装包得到sublime-phpcs-master,把sublime-phpcs-master文件夹放到sublime安装目录下的Packages/目录下;重启sublime, 打开Sublime Text 3->Preferences->Package Settings -> Php Code Sniffer 证明插件安装成功;
注意:不要从package controller上安装,后面报nicodedecodeerror错误,改不了源码。
pagekages目录可以在sublime中打开一个配置文件找到,如图:
第二步:下载php-cs-fixer.phar 地址 http://cs.sensiolabs.org/get/php-cs-fixer.phar ;
第三步:把php-cs-fixer.phar 放到你的 php.exe 安装目录 (例如(mine is C:/WAMP/php/php.exe));
第四步:下载 http://download.pear.php.net/package/PHP_CodeSniffer-1.5.0RC4.tgz,解压,然后找到scripts目录下的phpcs.bat,放到php.exe 安装目录;
注意:在这一步中,我没有成功,解决方法参考这里写链接内容
第五步:解压打开 第一步下载的php code sniffer安装包,在子文件example-settings下有个文件
windows-7-phpcs-fixer-linter.example 就是Sublime Text 3 在windows7配置 PHPCS 的样例,还有一个nix-all-commands.example是在linux/unix环境下的配置样例
第六步:以下就是windows-7-phpcs-fixer-linter.example的配置内容,打开你的Sublime Text 3->Preferences->Package Settings -> Php Code Sniffer -> Settings - User ,复制 windows-7-phpcs-fixer-linter.example 的内容到配置文件phpcs.sublime-settings,然后修改对应的php.exe路径
{ // Example for: // - Windows 8.1 // - With phpcs and php-cs-fixer support // - You have to change "YOUR_USERNAME_HERE" strings. // - Notice: This uses phpcs which is installed // - using composer not xampp. // - Be sure to install phpcs using composer. // We want debugging on "show_debug": true, // Only execute the plugin for php files "extensions_to_execute": ["php"], // Do not execute for twig files "extensions_to_blacklist": ["twig.php"], // Execute the sniffer on file save "phpcs_execute_on_save": true, // Show the error list after save. "phpcs_show_errors_on_save": true, // Show the errors in the gutter "phpcs_show_gutter_marks": true, // Show outline for errors "phpcs_outline_for_errors": true, // Show the errors in the status bar "phpcs_show_errors_in_status": true, // Show the errors in the quick panel so you can then goto line "phpcs_show_quick_panel": true, // 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:\\wamp\\bin\\php\\php7.0\\php.exe", // We want the fixer to be run through the php application "phpcs_commands_to_php_prefix": ["Fixer"], // PHP_CodeSniffer settings // Yes, run the phpcs command "phpcs_sniffer_run": true, // And execute it on save "phpcs_command_on_save": true, // This is the path to the bat file when we installed PHP_CodeSniffer "phpcs_executable_path": "D:\\wamp\\bin\\php\\php7.0\\PHP_CodeSniffer-1.5.0RC4\\scripts\\phpcs.bat", // I want to run the PSR2 standard, and ignore warnings "phpcs_additional_args": { "--standard": "PSR2", "-n": "" }, // 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:\\wamp\\bin\\php\\php7.0\\php-cs-fixer.phar", // Additional arguments, run all levels of fixing "php_cs_fixer_additional_args": { }, // 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:\\wamp\\bin\\php\\php7.0\\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": {}}
- sublime text 3 phpcs
- Sublime Text 3配置php语法错误提示插件PHPCS
- Sublime Text 3配置php语法错误提示插件PHPCS
- sublime phpcs
- Sublime Text 3配置php语法错误提示插件PHPCS (windows7环境)
- Sublime Text 3配置php语法错误提示插件PHPCS(windows 7)
- sublime 安装phpcs
- sublime 安装phpcs
- sublime text 3
- Sublime text 3快捷键
- Sublime Text 3
- sublime text 3 序列号
- Sublime Text 3 配置
- Sublime Text 3 使用
- Sublime Text 3 快捷键
- Sublime Text 3 license
- sublime text 3
- 工具--sublime text 3
- Jenkins安装部署
- java设计模式13_享元模式
- Jquery仿美团外卖等食品选择页面购物车数量加减功能实现
- 蒙特卡洛方法
- java设计模式14_责任链模式
- sublime text 3 phpcs
- Mysql 开启Federated引擎的方法
- Q25_数据流中的中位数
- DQL、DML、DDL、DCL的概念与区别
- LINQ_to_SQL语法及实例大全
- 基于Spark的移动用户主要活动地点的挖掘算法实现以及JavaEE技术整合
- leetcode——15.3Sum
- 计算广告课程小结
- webjs--两种时钟