Skip to content

Commit

Permalink
Now working with phpmd/phpmd 2.14.0 and up
Browse files Browse the repository at this point in the history
Fixes #243
  • Loading branch information
stronk7 committed Sep 28, 2023
1 parent 53e5192 commit ace4420
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"sebastian/phpcpd": "^6.0.3",
"sebastian/version": "^3.0.2",
"phpunit/php-timer": "^5.0.3",
"phpmd/phpmd": "2.13.*",
"phpmd/phpmd": "^2.14.0",
"symfony/dotenv": "^5.4",
"symfony/filesystem": "^5.4",
"symfony/finder": "^5.4",
Expand Down
19 changes: 10 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).

## [Unreleased]
### Fixed
- Fixed the `phpcmd` command for compatibility with versions `^2.14.0`.

## [4.1.6] - 2023-09-28
### Changed
- 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.
Expand Down
9 changes: 8 additions & 1 deletion src/Command/MessDetectorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$ruleSetFactory = new RuleSetFactory();
$ruleSetFactory->setMinimumPriority(5);
$ruleSets = $ruleSetFactory->createRuleSets($rules);

$messDetector = new PHPMD();
$messDetector->processFiles(implode(',', $files), $rules, [$renderer], $ruleSetFactory, new Report());
$messDetector->processFiles(
implode(',', $files),
[], // Ignored paths and files are managed by the plugin, so they are not needed here.
[$renderer],
$ruleSets,
new Report(),
);

return 0;
}
Expand Down

0 comments on commit ace4420

Please sign in to comment.