Add errors-only flag

This commit is contained in:
Wendell Adriel
2023-08-18 10:13:28 +01:00
parent c9e3932637
commit 8ea7b2b802
3 changed files with 43 additions and 3 deletions

View File

@ -74,7 +74,7 @@ final class Coverage
* Reports the code coverage report to the
* console and returns the result in float.
*/
public static function report(OutputInterface $output): float
public static function report(OutputInterface $output, float $coverageMin, bool $showErrorsOnly): float
{
if (! file_exists($reportPath = self::getPath())) {
if (self::usingXdebug()) {
@ -126,6 +126,10 @@ final class Coverage
$truncateAt = max(1, terminal()->width() - 12);
if ($showErrorsOnly && (float) $percentage >= $coverageMin) {
continue;
}
renderUsing($output);
render(<<<HTML
<div class="flex mx-2">