Skip to content

Commit

Permalink
Delete code that is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 7, 2024
1 parent 7590889 commit 40aa6ea
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
4 changes: 1 addition & 3 deletions src/Framework/TestRunner/SeparateProcessTestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/Framework/TestRunner/templates/class.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function __phpunit_run_isolated_test()

if ({collectCodeCoverageInformation}) {
CodeCoverage::instance()->init($configuration, CodeCoverageFilterRegistry::instance(), true);
CodeCoverage::instance()->ignoreLines({linesToBeIgnored});
}

$deprecationTriggers = [
Expand Down
1 change: 0 additions & 1 deletion src/Framework/TestRunner/templates/method.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function __phpunit_run_isolated_test()

if ({collectCodeCoverageInformation}) {
CodeCoverage::instance()->init($configuration, CodeCoverageFilterRegistry::instance(), true);
CodeCoverage::instance()->ignoreLines({linesToBeIgnored});
}

$deprecationTriggers = [
Expand Down
23 changes: 1 addition & 22 deletions src/Runner/CodeCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ final class CodeCoverage
private ?TestCase $test = null;
private ?Timer $timer = null;

/**
* @var array<string,list<int>>
*/
private array $linesToBeIgnored = [];

public static function instance(): self
{
if (self::$instance === null) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -340,22 +335,6 @@ public function generateReports(Printer $printer, Configuration $configuration):
}
}

/**
* @param array<string,list<int>> $linesToBeIgnored
*/
public function ignoreLines(array $linesToBeIgnored): void
{
$this->linesToBeIgnored = $linesToBeIgnored;
}

/**
* @return array<string,list<int>>
*/
public function linesToBeIgnored(): array
{
return $this->linesToBeIgnored;
}

private function activate(Filter $filter, bool $pathCoverage): void
{
try {
Expand Down

0 comments on commit 40aa6ea

Please sign in to comment.