Automatically install a git pre-commit hook to check your PHP files upon each commit to make sure they follow the rules defined in phpmd.xml
.
Add as a development requirement to your composer.json
:
composer require --dev pascal-splotches/php-composter-phpmd
It automatically works whenever you execute a git commit
.
You need to add a configuration section to your phpmd.xml
ruleset with the correct flags and paths:
<configuration>
<!-- Required -->
<source>
<path>src</path>
<!-- <path></path>... -->
</source>
<!-- Optional -->
<exclude>
<path>docs</path>
<!-- <path></path>... -->
</exclude>
<!-- Required -->
<output mode="text"/>
<!-- Optional -->
<minimum-priority value="5"/>
<report file="report.txt"/>
<!-- Optional -->
<suffixes>
<suffix>php</suffix>
<!-- <suffix></suffix>... -->
</suffixes>
<!-- Optional -->
<strict/>
</configuration>
All feedback, bug reports and pull requests are welcomed.
We use SemVer for versioning. For the versions available, see the releases on this repository.
- Pascal Scheepers pascal@splotch.es
This project is licensed under the GPL v3 License - see the LICENSE file for details.