From 40aa6ead7556f5a6a5364cc1b873fc057370e2b0 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 7 Dec 2024 10:37:37 +0100 Subject: [PATCH] Delete code that is no longer needed --- .../TestRunner/SeparateProcessTestRunner.php | 4 +--- src/Framework/TestRunner/templates/class.tpl | 1 - src/Framework/TestRunner/templates/method.tpl | 1 - src/Runner/CodeCoverage.php | 23 +------------------ 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/Framework/TestRunner/SeparateProcessTestRunner.php b/src/Framework/TestRunner/SeparateProcessTestRunner.php index d29907550af..92b45b36047 100644 --- a/src/Framework/TestRunner/SeparateProcessTestRunner.php +++ b/src/Framework/TestRunner/SeparateProcessTestRunner.php @@ -88,8 +88,7 @@ public function run(TestCase $test, bool $runEntireClass, bool $preserveGlobalSt $iniSettings = GlobalState::getIniSettingsAsString(); } - $coverage = CodeCoverage::instance()->isActive() ? 'true' : 'false'; - $linesToBeIgnored = var_export(CodeCoverage::instance()->linesToBeIgnored(), true); + $coverage = CodeCoverage::instance()->isActive() ? 'true' : 'false'; if (defined('PHPUNIT_COMPOSER_INSTALL')) { $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); @@ -128,7 +127,6 @@ public function run(TestCase $test, bool $runEntireClass, bool $preserveGlobalSt 'filename' => $file, 'className' => $class->getName(), 'collectCodeCoverageInformation' => $coverage, - 'linesToBeIgnored' => $linesToBeIgnored, 'data' => $data, 'dataName' => $dataName, 'dependencyInput' => $dependencyInput, diff --git a/src/Framework/TestRunner/templates/class.tpl b/src/Framework/TestRunner/templates/class.tpl index be3693a1006..2067b1e87f3 100644 --- a/src/Framework/TestRunner/templates/class.tpl +++ b/src/Framework/TestRunner/templates/class.tpl @@ -46,7 +46,6 @@ function __phpunit_run_isolated_test() if ({collectCodeCoverageInformation}) { CodeCoverage::instance()->init($configuration, CodeCoverageFilterRegistry::instance(), true); - CodeCoverage::instance()->ignoreLines({linesToBeIgnored}); } $deprecationTriggers = [ diff --git a/src/Framework/TestRunner/templates/method.tpl b/src/Framework/TestRunner/templates/method.tpl index 6b5aba47bac..c0130ea8641 100644 --- a/src/Framework/TestRunner/templates/method.tpl +++ b/src/Framework/TestRunner/templates/method.tpl @@ -46,7 +46,6 @@ function __phpunit_run_isolated_test() if ({collectCodeCoverageInformation}) { CodeCoverage::instance()->init($configuration, CodeCoverageFilterRegistry::instance(), true); - CodeCoverage::instance()->ignoreLines({linesToBeIgnored}); } $deprecationTriggers = [ diff --git a/src/Runner/CodeCoverage.php b/src/Runner/CodeCoverage.php index 280a9650364..54d37dde9cc 100644 --- a/src/Runner/CodeCoverage.php +++ b/src/Runner/CodeCoverage.php @@ -52,11 +52,6 @@ final class CodeCoverage private ?TestCase $test = null; private ?Timer $timer = null; - /** - * @var array> - */ - private array $linesToBeIgnored = []; - public static function instance(): self { if (self::$instance === null) { @@ -188,7 +183,7 @@ public function stop(bool $append = true, array|false $linesToBeCovered = [], ar } /* @noinspection UnusedFunctionResultInspection */ - $this->codeCoverage->stop($append, $status, $linesToBeCovered, $linesToBeUsed, $this->linesToBeIgnored); + $this->codeCoverage->stop($append, $status, $linesToBeCovered, $linesToBeUsed); $this->test = null; $this->collecting = false; @@ -340,22 +335,6 @@ public function generateReports(Printer $printer, Configuration $configuration): } } - /** - * @param array> $linesToBeIgnored - */ - public function ignoreLines(array $linesToBeIgnored): void - { - $this->linesToBeIgnored = $linesToBeIgnored; - } - - /** - * @return array> - */ - public function linesToBeIgnored(): array - { - return $this->linesToBeIgnored; - } - private function activate(Filter $filter, bool $pathCoverage): void { try {