From 400f38abca4d2b584ebbf7957c00cd8b0ae84feb Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Fri, 30 Oct 2026 15:03:59 +0100 Subject: [PATCH 1/2] chore: harness 0.1.15, and keep the development files out of the archive Raises pollora/harness to ^0.1.15 and the workflow to @v0.1.15. The new Distribution archive gate (QA-06) reports the development files a release archive carries; pollora-qa archive --fix adds the export-ignore lines it asks for. --- .gitattributes | 15 +++++++++++++++ .github/workflows/harness.yml | 2 +- composer.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..eabea0d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +# Pollora harness (QA-06): development files stay out of the archive Composer downloads +/.claude export-ignore +/.gitattributes export-ignore +/.github export-ignore +/.gitignore export-ignore +/.harness.json export-ignore +/AGENTS.md export-ignore +/api-surface.json export-ignore +/composer-dependency-analyser.php export-ignore +/phpstan.neon export-ignore +/phpunit.xml.dist export-ignore +/pint.json export-ignore +/rector.php export-ignore +/renovate.json export-ignore +/tests export-ignore diff --git a/.github/workflows/harness.yml b/.github/workflows/harness.yml index ad6e301..0164122 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.8 + uses: Pollora/harness/.github/workflows/php-package.yml@v0.1.15 permissions: contents: read diff --git a/composer.json b/composer.json index 5472a49..dae5a35 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "pestphp/pest": "^3.8", "php-stubs/wordpress-stubs": "^7.1", "phpstan/phpstan": "^2.1", - "pollora/harness": "^0.1.8", + "pollora/harness": "^0.1.15", "szepeviktor/phpstan-wordpress": "^2.0" }, "autoload": { From d279a76e7129cd4ef3e5569c55082f294d4c98cb Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Fri, 30 Oct 2026 15:20:33 +0100 Subject: [PATCH 2/2] refactor: compare the reflection class with instanceof Rector's ExplicitNullableObjectInstanceRector, which the Quality gates now report on this line. $scopeClass is a ReflectionClass or null: same result. --- src/Collectors/WpHooksCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Collectors/WpHooksCollector.php b/src/Collectors/WpHooksCollector.php index 5312896..6acac83 100644 --- a/src/Collectors/WpHooksCollector.php +++ b/src/Collectors/WpHooksCollector.php @@ -130,7 +130,7 @@ private static function describeClosure(\Closure $closure): string // A file included from a method (a mu-plugin WordPress loads from // Pollora's Bootstrap) gives its closures that class's scope: name // the class only when the closure is written in it - $scope = $scopeClass !== null && $scopeClass->getFileName() === $reflection->getFileName() ? $scopeClass->getName() : null; + $scope = $scopeClass instanceof \ReflectionClass && $scopeClass->getFileName() === $reflection->getFileName() ? $scopeClass->getName() : null; if (! str_contains($reflection->getName(), '{closure')) { return $scope !== null ? "{$scope}::{$reflection->getName()}" : $reflection->getName();