chillu/phpmd-silverstripe

此软件包已被放弃且不再维护。未建议替代软件包。

为SilverStripe应用程序扩展了phpmd的杂乱检测规则。

0.1.0 2015-07-08 10:11 UTC

This package is not auto-updated.

Last update: 2018-01-08 14:17:34 UTC


README

Build Status

SilverStripe应用程序从phpmd扩展的杂乱检测规则。这些规则使开发人员更容易遵守SilverStripe编码规范。它主要使用标准的PHPMD规则,并进行了一些显著的修改

  • UnusedPrivateField替换为UnusedInstancePrivateField规则,仅检查实例字段。在SilverStripe中,未使用的私有静态字段是按设计。
  • CamelCasePropertyName替换为CamelCaseInstancePropertyName规则。在SilverStripe中,静态属性使用蛇形命名。
  • 移除了对camelCase命名约定的僵化检查

安装

全局安装,用于跨项目使用

composer global require --prefer-dist chillu/phpmd-silverstripe

在现有项目上的本地安装

composer require chillu/phpmd-silverstripe

用法

对于全局安装

~/.composer/vendor/bin/phpmd <my-project> text ~/.composer/vendor/chillu/phpmd-silverstripe/Rulesets/all.xml

对于本地安装

vendor/bin/phpmd <my-project> text vendor/chillu/phpmd-silverstripe/Rulesets/all.xml

有关更多详细信息,请参阅phpmd.org上的命令行使用指南。