Skip to content

Instantly share code, notes, and snippets.

@fpapadopou
Forked from manuelpichler/bash
Last active August 29, 2015 14:13
Show Gist options
  • Save fpapadopou/baa747b0d07719988c90 to your computer and use it in GitHub Desktop.
Save fpapadopou/baa747b0d07719988c90 to your computer and use it in GitHub Desktop.
manu@Samweis PHP_PMD-git $ src/bin/phpmd --version
PHPMD 2.2.0
manu@Samweis PHP_PMD-git $ src/bin/phpmd /tmp/short.php text /tmp/naming.xml
manu@Samweis PHP_PMD-git $
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Naming Rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
The Naming Ruleset contains a collection of rules about names - too long, too short, and so forth.
</description>
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="id,q,i,j,v,e,f,fp" />
</properties>
</rule>
</ruleset>
<?php
class Foo
{
public function foo($id) {
return $id * $id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment