phpphpmd

How can I set PHPMD rule properties?


I'm new to using PHP Mess Detector (PHPMD) and want to teak some of the parameters. For example, the naming rules are giving me output like this:

"Avoid variables with short names like $id. Configured minimum length is 3."

Can I change the "configured minimum length" without copying and altering the XML ruleset file?

The message suggests to me that the user of this ruleset can configure these boundaries, and in the Naming Rules docs are "properties" summaries for each method with a "default value".

Can I specify properties on the command line, or is there a general config file somewhere?


Solution

  • I'm afraid you will have to copy and alter the ruleset file. PHPMD does not support clanging properties on the command line.