From 2fb46c24d1d154c2aa510c151ae4af678921c0f5 Mon Sep 17 00:00:00 2001 From: Pollora maintainer Date: Sun, 6 Dec 2026 18:42:43 +0100 Subject: [PATCH 1/2] chore(harness): update to v0.1.44, lift the PHPStan cap to ^2.4 Development only. Carries the dev-only patch for pest-plugin-type-coverage (upstream pestphp/pest-plugin-type-coverage#84) through a root-only patches.json kept out of the archive, and drops the deprecated Rector earlyReturn option. --- .gitattributes | 3 ++ composer.json | 6 ++-- patches.json | 7 ++++ patches.lock.json | 17 ++++++++++ ...est-plugin-type-coverage-phpstan-2.4.patch | 33 +++++++++++++++++++ rector.php | 1 - 6 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 patches.json create mode 100644 patches.lock.json create mode 100644 patches/pest-plugin-type-coverage-phpstan-2.4.patch diff --git a/.gitattributes b/.gitattributes index da5539b..26f8868 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,3 +17,6 @@ /pint.json export-ignore /rector.php export-ignore /tests export-ignore +/patches.json export-ignore +/patches.lock.json export-ignore +/patches export-ignore diff --git a/composer.json b/composer.json index 33917b2..ae26f4e 100644 --- a/composer.json +++ b/composer.json @@ -18,11 +18,12 @@ "symfony/process": "^7.0" }, "require-dev": { + "cweagans/composer-patches": "^2.0", "larastan/larastan": "^3.3", "laravel/pint": "^1.21", "pestphp/pest": "^3.8", - "pestphp/pest-plugin-type-coverage": "^3.5", - "phpstan/phpstan": "^2.1 <2.3.6", + "pestphp/pest-plugin-type-coverage": "^3.6.1", + "phpstan/phpstan": "^2.4", "pollora/harness": "^0.1.43", "rector/rector": "^2.0" }, @@ -60,6 +61,7 @@ "config": { "sort-packages": true, "allow-plugins": { + "cweagans/composer-patches": true, "pestphp/pest-plugin": true } }, diff --git a/patches.json b/patches.json new file mode 100644 index 0000000..b56cb18 --- /dev/null +++ b/patches.json @@ -0,0 +1,7 @@ +{ + "patches": { + "pestphp/pest-plugin-type-coverage": { + "Read collected data with PHPStan 2.4 (upstream pestphp/pest-plugin-type-coverage#84)": "patches/pest-plugin-type-coverage-phpstan-2.4.patch" + } + } +} diff --git a/patches.lock.json b/patches.lock.json new file mode 100644 index 0000000..1d92eaa --- /dev/null +++ b/patches.lock.json @@ -0,0 +1,17 @@ +{ + "_hash": "528dec89935dd286f07355e7b2d63fd3b532b076eb3caf1ff15fc77ebb470e97", + "patches": { + "pestphp/pest-plugin-type-coverage": [ + { + "package": "pestphp/pest-plugin-type-coverage", + "description": "Read collected data with PHPStan 2.4 (upstream pestphp/pest-plugin-type-coverage#84)", + "url": "patches/pest-plugin-type-coverage-phpstan-2.4.patch", + "sha256": "46d475a6e21428278da863d58724bd8163d742980fa823c64c6cc74f99661bce", + "depth": 1, + "extra": { + "provenance": "patches-file:patches.json" + } + } + ] + } +} diff --git a/patches/pest-plugin-type-coverage-phpstan-2.4.patch b/patches/pest-plugin-type-coverage-phpstan-2.4.patch new file mode 100644 index 0000000..d224c66 --- /dev/null +++ b/patches/pest-plugin-type-coverage-phpstan-2.4.patch @@ -0,0 +1,33 @@ +--- a/src/TestCaseForTypeCoverage.php ++++ b/src/TestCaseForTypeCoverage.php +@@ -111,22 +111,26 @@ + + $actualErrors = $analyserResult->getUnorderedErrors(); + $ruleErrorTransformer = self::getContainer()->getByType(RuleErrorTransformer::class); +- if ($analyserResult->getCollectedData() !== []) { ++ $collectedData = method_exists($analyserResult, 'getLazyCollectedData') ++ ? $analyserResult->getLazyCollectedData()->toArray() ++ : $analyserResult->getCollectedData(); ++ ++ if ($collectedData !== []) { + $ruleRegistry = new DirectRegistry($this->getRules()); + $nodeType = CollectedDataNode::class; +- $node = new CollectedDataNode($analyserResult->getCollectedData(), true); ++ $node = new CollectedDataNode($collectedData, true); + $scopeFactory = $this->createScopeFactory($this->createReflectionProvider(), $this->getTypeSpecifier()); + $scope = $scopeFactory->create(ScopeContext::create('irrelevant')); + foreach ($ruleRegistry->getRules($nodeType) as $rule) { + $ruleErrors = $rule->processNode($node, $scope); + foreach ($ruleErrors as $ruleError) { + if ($this->ignored($ruleError)) { +- $this->ignoredErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, [], $node); ++ $this->ignoredErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, [], $node, false); + + continue; + } + +- $actualErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, [], $node); ++ $actualErrors[] = $ruleErrorTransformer->transform($ruleError, $scope, [], $node, false); + } + } + } diff --git a/rector.php b/rector.php index 22a883e..66c6047 100644 --- a/rector.php +++ b/rector.php @@ -14,7 +14,6 @@ codeQuality: true, typeDeclarations: true, privatization: true, - earlyReturn: true, codingStyle: true, ) ->withPhpSets(); From a74a9662041d8d5bb36944dc795fb523b8de6f42 Mon Sep 17 00:00:00 2001 From: Pollora maintainer Date: Sun, 6 Dec 2026 18:53:28 +0100 Subject: [PATCH 2/2] chore(harness): require pollora/harness ^0.1.44 and call the workflow at v0.1.44 --- .github/workflows/harness.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/harness.yml b/.github/workflows/harness.yml index d9bebc8..4ca7d48 100644 --- a/.github/workflows/harness.yml +++ b/.github/workflows/harness.yml @@ -14,6 +14,6 @@ permissions: {} jobs: harness: - uses: Pollora/harness/.github/workflows/php-package.yml@v0.1.43 + uses: Pollora/harness/.github/workflows/php-package.yml@v0.1.44 permissions: contents: read diff --git a/composer.json b/composer.json index ae26f4e..92d5c93 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "pestphp/pest": "^3.8", "pestphp/pest-plugin-type-coverage": "^3.6.1", "phpstan/phpstan": "^2.4", - "pollora/harness": "^0.1.43", + "pollora/harness": "^0.1.44", "rector/rector": "^2.0" }, "bin": [