Skip to content

Commit

Permalink
Add phpmd configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed May 14, 2024
1 parent 1509ee7 commit 80cffd6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"phpcs": "phpcs --standard=tests/phpcs.xml",
"phpcbf": "phpcbf --standard=tests/phpcs.xml",
"phpstan": "phpstan -ctests/PhpStan/phpstan.neon analyse src/",
"phpmd": "phpmd src text cleancode,codesize,design,unusedcode",
"phpmd": "phpmd src ansi tests/PhpMd/standard.xml",
"static": [
"@phpcs",
"@phpstan",
Expand Down
29 changes: 29 additions & 0 deletions tests/PhpMd/standard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<ruleset name="Standard PHPMD rule set for Oxid"
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>
Standard OXID Ruleset
</description>

<rule ref="rulesets/cleancode.xml/StaticAccess">
<properties>
<property name="exceptions">
<value>
\Symfony\Component\Filesystem\Path
</value>
</property>
</properties>
</rule>

<rule ref="rulesets/codesize.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml">
<exclude name="LongVariable" />
</rule>
<rule ref="rulesets/unusedcode.xml" />
</ruleset>

0 comments on commit 80cffd6

Please sign in to comment.