PhpMetrics icon indicating copy to clipboard operation
PhpMetrics copied to clipboard

JUnit config parameter docs don't match what the code actually does

Open AlexHowansky opened this issue 4 years ago • 1 comments

Bug report

Version 2.7.4

The README.md file includes this configuration file example of linking to a JUnit report:

"junit": {
    "file": "/tmp/junit.xml"
}

However, the code in Hal\Application\Config\File\ConfigFileReaderJson uses the key report and not the key file:

if (isset($jsonData['plugins'], $jsonData['plugins']['junit'], $jsonData['plugins']['junit']["report"])) {

Thus, either the README.md should be changed to:

"junit": {
    "report": "/tmp/junit.xml"
}

Or the Hal\Application\Config\File\ConfigFileReaderJson should be changed to:

if (isset($jsonData['plugins'], $jsonData['plugins']['junit'], $jsonData['plugins']['junit']["file"])) {

I did not create a pull request for this change as I don't know which of these two keys was intended and it's trivial enough to implement.

AlexHowansky avatar Oct 09 '20 17:10 AlexHowansky

Thanks for the report. This will be fixed with https://github.com/phpmetrics/PhpMetrics/pull/457

Halleck45 avatar Jun 07 '21 07:06 Halleck45