Skip to content

Commit

Permalink
Return error exit code for "No lines…" error.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec authored Jul 8, 2022
1 parent cdda0be commit cf4ee54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ function handleOutput(array $lines, float $minimumPercentCovered, Output $output


if ($coveredLines + $uncoveredLines == 0) {
error_log('No lines found!');
return;
throw new Exception(
'No lines found!',
3
);
}

$percentCovered = 100 * ($coveredLines / ($coveredLines + $uncoveredLines));
Expand Down

0 comments on commit cf4ee54

Please sign in to comment.