diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3f9532b6..1e4d90a3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15,16 +15,6 @@ parameters: count: 1 path: src/Options.php - - - message: "#^Call to an undefined method PHPUnit\\\\Metadata\\\\Api\\\\CodeCoverage\\:\\:linesToBeIgnored\\(\\)\\.$#" - count: 1 - path: src/WrapperRunner/ApplicationForWrapperWorker.php - - - - message: "#^Call to an undefined method PHPUnit\\\\Runner\\\\Filter\\\\Factory\\:\\:addNameFilter\\(\\)\\.$#" - count: 1 - path: src/WrapperRunner/ApplicationForWrapperWorker.php - - message: "#^Match expression does not handle remaining value\\: string$#" count: 1 diff --git a/src/WrapperRunner/ApplicationForWrapperWorker.php b/src/WrapperRunner/ApplicationForWrapperWorker.php index 7748f03b..f678ce99 100644 --- a/src/WrapperRunner/ApplicationForWrapperWorker.php +++ b/src/WrapperRunner/ApplicationForWrapperWorker.php @@ -19,7 +19,6 @@ use PHPUnit\Runner\Filter\Factory; use PHPUnit\Runner\TestSuiteLoader; use PHPUnit\Runner\TestSuiteSorter; -use PHPUnit\Runner\Version; use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade; use PHPUnit\TextUI\Configuration\Builder; use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; @@ -41,7 +40,6 @@ use function str_ends_with; use function strpos; use function substr; -use function version_compare; /** * @internal @@ -75,11 +73,7 @@ public function runTest(string $testPath): int $filter = new Factory(); $name = substr($testPath, $null + 1); assert($name !== ''); - if (version_compare(Version::id(), '11.0.0') >= 0) { - $filter->addIncludeNameFilter($name); - } else { - $filter->addNameFilter($name); - } + $filter->addNameFilter($name); $testPath = substr($testPath, 0, $null); } @@ -94,12 +88,10 @@ public function runTest(string $testPath): int $testSuite = TestSuite::fromClassReflector($testSuiteRefl); } - if (version_compare(Version::id(), '11.0.0') < 0) { - if (CodeCoverage::instance()->isActive()) { - CodeCoverage::instance()->ignoreLines( - (new CodeCoverageMetadataApi())->linesToBeIgnored($testSuite), - ); - } + if (CodeCoverage::instance()->isActive()) { + CodeCoverage::instance()->ignoreLines( + (new CodeCoverageMetadataApi())->linesToBeIgnored($testSuite), + ); } (new TestSuiteFilterProcessor())->process($this->configuration, $testSuite); @@ -234,7 +226,7 @@ public function end(): void assert(isset($this->testdoxFile)); assert(isset($this->testdoxColumns)); - (new TestDoxResultPrinter(DefaultPrinter::from($this->testdoxFile), $this->testdoxColor, $this->testdoxColumns))->print( + (new TestDoxResultPrinter(DefaultPrinter::from($this->testdoxFile), $this->testdoxColor))->print( $this->testdoxResultCollector->testMethodsGroupedByClass(), ); }