pre-commit-php
pre-commit-php copied to clipboard
Add new php-cpd commit hook
Feature
PHP Copy Paste Detector is a QA tool that can be used to find duplicate code. This adds a new pre-commit-php hook for calling phpcpd
.
Implementation
This is fairly straightforward and also follows the general pattern of php-cs-fixer
. This will ONLY analyze the files that are staged for duplicate code, and not the entire project. A feature to scan the entire project could perhaps be added.
Sample Output
Review
This was a little rushed, and the commit to both the README and hooks files have the entries from php-md
in it. This should sort itself out in the merge, but if you'd like a tidier PR, please let me know.