Skip to content

Commit

Permalink
Merge pull request moodlehq#244 from stronk7/phpmd_bump
Browse files Browse the repository at this point in the history
Now working with phpmd/phpmd 2.14.0 and up
  • Loading branch information
kabalin authored Sep 28, 2023
2 parents 53e5192 + ace4420 commit ee2c559
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 ee2c559

Please sign in to comment.