Skip to content

Commit a29e4ad

Browse files
Merge pull request #48 from youwe-petervanderwal/feat/pimcore-phpmd
feat: pimcore phpmd config
2 parents 857a449 + 2397859 commit a29e4ad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Pimcore coding standards with [PER coding standards](https://www.php-fig.org/per/coding-style/).
2020
- Added support for an Allow List within the Security Checker.
2121
- Pimcore PHPStan default config.
22+
- Pimcore PHP Mess Detector default config.
2223

2324
### Changed
2425
- [BREAKING] The composer.json configurations `config.youwe-testing-suite.type` and `config.mediact-testing-suite.type`

config/pimcore/phpmd.xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,26 @@
2121
<rule ref="rulesets/codesize.xml" />
2222
<rule ref="rulesets/design.xml" />
2323
<rule ref="rulesets/unusedcode.xml" />
24-
<rule ref="rulesets/naming.xml" />
24+
<rule ref="rulesets/naming.xml">
25+
<!-- For these rules we have exceptions configured below -->
26+
<exclude name="LongVariable" />
27+
<exclude name="ShortVariable" />
28+
<exclude name="ShortMethodName" />
29+
</rule>
2530

2631
<rule ref="rulesets/naming.xml/LongVariable">
2732
<properties>
2833
<!-- 20 limit is hard to make descriptive, plus has historically been 30 so also for better backwards compatibility support -->
2934
<property name="maximum" value="30"/>
3035
</properties>
3136
</rule>
32-
<!-- End of global ruleset -->
37+
38+
<!-- $id is a very common (and accepted) ShortVariable -->
39+
<rule ref="rulesets/naming.xml/ShortVariable">
40+
<properties>
41+
<property name="exceptions" value="id" />
42+
</properties>
43+
</rule>
3344

3445
<!-- up() is required for doctrine migrations when implementing the interface. -->
3546
<rule ref="rulesets/naming.xml/ShortMethodName">

0 commit comments

Comments
 (0)