Skip to content

Commit ee2c559

Browse files
authored
Merge pull request #244 from stronk7/phpmd_bump
Now working with phpmd/phpmd 2.14.0 and up
2 parents 53e5192 + ace4420 commit ee2c559

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"sebastian/phpcpd": "^6.0.3",
6262
"sebastian/version": "^3.0.2",
6363
"phpunit/php-timer": "^5.0.3",
64-
"phpmd/phpmd": "2.13.*",
64+
"phpmd/phpmd": "^2.14.0",
6565
"symfony/dotenv": "^5.4",
6666
"symfony/filesystem": "^5.4",
6767
"symfony/finder": "^5.4",

composer.lock

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).
1010

1111
## [Unreleased]
12+
### Fixed
13+
- Fixed the `phpcmd` command for compatibility with versions `^2.14.0`.
14+
1215
## [4.1.6] - 2023-09-28
1316
### Changed
1417
- Updated project dependencies to current [moodle-cs](https://github.com/moodlehq/moodle-cs) and [moodle-local_ci](https://github.com/moodlehq/moodle-local_ci) versions.

src/Command/MessDetectorCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5151

5252
$ruleSetFactory = new RuleSetFactory();
5353
$ruleSetFactory->setMinimumPriority(5);
54+
$ruleSets = $ruleSetFactory->createRuleSets($rules);
5455

5556
$messDetector = new PHPMD();
56-
$messDetector->processFiles(implode(',', $files), $rules, [$renderer], $ruleSetFactory, new Report());
57+
$messDetector->processFiles(
58+
implode(',', $files),
59+
[], // Ignored paths and files are managed by the plugin, so they are not needed here.
60+
[$renderer],
61+
$ruleSets,
62+
new Report(),
63+
);
5764

5865
return 0;
5966
}

0 commit comments

Comments
 (0)