mac下phpStorm配置使用phpmd

发布 : 2017-04-01 分类 : Software 浏览 :

什么是phpmd

phpmd,short of PHP Mess Detector,is a tool that checks if you aren’t making a mess of your code. Think of methods of hundreds of lines, classes that extend class after class after class, lack of documentation, nested loops, etc. PHP Mess Detector points out these culprits and aids into writing more manageable code.

安装phpmd

1
brew install phpmd

安装之后查看phpmd的路径
20170401149103931820920.png
路径就是/usr/local/bin/phpmd

配置phpmd

Preferences/Languages & Frameworks/PHP/Mess Detector
20170401149103941390595.png
点开Local后的...,输入phpmd的路径/usr/local/bin/phpmd,点击Validate进行验证
20170401149103954380798.png

Preferences/Editor/Inspections/PHP/PHP Mess Detector validation

20170401149103936778520.png
勾选中PHP Mess Detector validation,并选择右侧建议的Options规则,规则的说明参考:https://phpmd.org/rules/index.html
20170401149103968164148.png

使用phpmd

20170401149103926528991.png

本文作者 : 小凡
原文链接 : https://16bh.github.io/2017/04/01/phpmd-in-phpstorm-on-mac/
版权声明 : 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!
留下足迹