Skip to content

Commit 16fe0a2

Browse files
authored
Allow floats to be used for coverage
We're playing with "previous coverage" vs. "new coverage" and "previous coverage" echoes floats.
1 parent 8984ce2 commit 16fe0a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coverage-check.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212

1313
$inputFile = $argv[1];
14-
$percentage = min(100, max(0, (int)$argv[2]));
14+
$percentage = min(100, max(0, (float)$argv[2]));
1515

1616
$xml = new SimpleXMLElement(file_get_contents($inputFile));
1717
$metrics = $xml->xpath('//metrics');
@@ -40,4 +40,4 @@
4040
exit(1);
4141
}
4242

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

0 commit comments

Comments
 (0)