Skip to content

Commit d872edc

Browse files
authored
Merge pull request #6 from ttomdewit/patch-1
Allow floats to be used for coverage
2 parents 8984ce2 + 16fe0a2 commit d872edc

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)