Skip to content

Commit 0dd8f2a

Browse files
committed
Added phpmd support for code quality checks
This commit introduces phpmd as a new dependency for code quality checks and has created a phpmd.xml configuration file for it. Moreover, the composer.json has been updated to include a dedicated command for running phpmd code quality checks.
1 parent 4ec24e9 commit 0dd8f2a

File tree

4 files changed

+1049
-3
lines changed

4 files changed

+1049
-3
lines changed

Diff for: .github/workflows/php.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHP lint & test
1+
name: PHP lint,scan & test
22

33
on: [push, pull_request]
44

@@ -27,6 +27,12 @@ jobs:
2727
- name: Run PHPCS Lint
2828
run: composer lint
2929

30+
- name: Run PHPStan
31+
run: composer phpstan
32+
33+
- name: Run PHPMD
34+
run: composer phpmd
35+
3036
- name: Run PHPUnit tests
3137
run: composer test
3238

Diff for: composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"phpstan/phpstan-strict-rules": "^1.6",
1818
"phpunit/phpunit": "^11.1",
1919
"slevomat/coding-standard": "^8.15",
20-
"squizlabs/php_codesniffer": "^3.10"
20+
"squizlabs/php_codesniffer": "^3.10",
21+
"phpmd/phpmd": "^2.15"
2122
},
2223
"autoload": {
2324
"psr-4": {
@@ -45,6 +46,7 @@
4546
"lint": "phpcs",
4647
"lint:fix": "phpcbf",
4748
"php:badge": "bin/coverage-badge coverage/clover.xml badges/php.svg PHP",
49+
"phpmd": "phpmd coverage-badge.php,src text phpmd.xml --color",
4850
"phpstan": "phpstan analyse --memory-limit=2048M",
4951
"test": "phpunit --testdox --coverage-clover coverage/clover.xml --coverage-html coverage --coverage-filter src/"
5052
}

0 commit comments

Comments
 (0)