Skip to content

Commit

Permalink
Allow floats to be used for coverage
Browse files Browse the repository at this point in the history
We're playing with "previous coverage" vs. "new coverage" and "previous coverage" echoes floats.
  • Loading branch information
ttomdewit committed Sep 27, 2019
1 parent 8984ce2 commit 16fe0a2
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 16fe0a2

Please sign in to comment.