Skip to content

Extended mess detection rules from phpmd for SilverStripe applications.

License

Notifications You must be signed in to change notification settings

helpfulrobot/chillu-phpmd-silverstripe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPMD rules for SilverStripe

Build Status

Extended mess detection rules from phpmd for SilverStripe applications. The rules make it easier for developers to comply with the SilverStripe Coding Conventions. It uses mostly standard PHPMD rules, with a few notable changes:

  • Replaced UnusedPrivateField with UnusedInstancePrivateField rule, to check to instance fields only. Unused private statics are by design in SilverStripe.
  • Replaced CamelCasePropertyName with CamelCaseInstancePropertyName rule. Static properties in SilverStripe are snake cased.
  • Removed inflexible checks around camelCase naming conventions

Installation

Global installation for usage across projects:

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

Local installation on an existing project:

composer require chillu/phpmd-silverstripe

Usage

For global installations:

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

For local installations:

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

For more details, refer to the command line usage guides on phpmd.org.

About

Extended mess detection rules from phpmd for SilverStripe applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages