From c3bfdf130e52c26e2ce3e7331fab059e16e7b0fd Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 16 Jun 2025 10:14:04 +0100 Subject: [PATCH] chore: type checking --- src/Bootstrappers/BootOverrides.php | 2 +- src/Support/Coverage.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Bootstrappers/BootOverrides.php b/src/Bootstrappers/BootOverrides.php index c9119219..a4eef19f 100644 --- a/src/Bootstrappers/BootOverrides.php +++ b/src/Bootstrappers/BootOverrides.php @@ -15,7 +15,7 @@ final class BootOverrides implements Bootstrapper /** * The list of files to be overridden. * - * @var array + * @var array */ public const array FILES = [ 'Runner/Filter/NameFilterIterator.php', diff --git a/src/Support/Coverage.php b/src/Support/Coverage.php index 1aa641fb..adcfa40d 100644 --- a/src/Support/Coverage.php +++ b/src/Support/Coverage.php @@ -88,13 +88,16 @@ final class Coverage throw ShouldNotHappen::fromMessage(sprintf('Coverage not found in path: %s.', $reportPath)); } - /** @var CodeCoverage $codeCoverage */ $handle = fopen($reportPath, 'r'); $code = ''; - while (! feof($handle)) { + while (is_resource($handle) && ! feof($handle)) { $code .= fread($handle, 8192); } - fclose($handle); + + if (is_resource($handle)) { + fclose($handle); + } + unlink($reportPath); $codeCoverage = eval(substr($code, 5));