From cf4ee54879c90ab6903cfd6158e376e95a3fbf92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Wytr=C4=99bowicz?= Date: Fri, 8 Jul 2022 14:15:00 +0200 Subject: [PATCH] =?UTF-8?q?Return=20error=20exit=20code=20for=20"No=20line?= =?UTF-8?q?s=E2=80=A6"=20error.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/exussum12/coverageChecker/issues/72 --- src/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/functions.php b/src/functions.php index f30fe61..58252b4 100644 --- a/src/functions.php +++ b/src/functions.php @@ -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));