Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example of how to customize the ShortVariable rule in PHP Mess Detector
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Custom Naming Rules"
Customizations for the naming rule sets. Do not include the naming ruleset in the options.
This customization pulls all naming rules in and overrides some properties.
<rule ref="rulesets/naming.xml">
<!-- To be able to customize a property on the ShortVariable rule it must first be excluded.
Does not really make sense, but see for details. -->
<exclude name="ShortVariable"/>
<rule ref="rulesets/naming.xml/ShortVariable">
<!-- Add common variable names that should be excepted from the default minimum property value of 3 -->
<property name="exceptions" description="Comma-separated list of exceptions" value="id"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.