Skip to content

Commit

Permalink
Merge pull request #6 from ttomdewit/patch-1
Browse files Browse the repository at this point in the history
Allow floats to be used for coverage
  • Loading branch information
rregeer authored Sep 27, 2019
2 parents 8984ce2 + 16fe0a2 commit d872edc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coverage-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

$inputFile = $argv[1];
$percentage = min(100, max(0, (int)$argv[2]));
$percentage = min(100, max(0, (float)$argv[2]));

$xml = new SimpleXMLElement(file_get_contents($inputFile));
$metrics = $xml->xpath('//metrics');
Expand Down Expand Up @@ -40,4 +40,4 @@
exit(1);
}

echo 'Total code coverage is ' . sprintf('%0.2f', $TPC) . '% - OK!' . PHP_EOL;
echo 'Total code coverage is ' . sprintf('%0.2f', $TPC) . '% - OK!' . PHP_EOL;

0 comments on commit d872edc

Please sign in to comment.