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));