From 361ee33d487a52d1004cae00e700f24111109673 Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Tue, 27 Oct 2026 14:41:19 +0100 Subject: [PATCH] chore: enforce Rector (src only), harness 0.1.8 --- .github/workflows/harness.yml | 2 +- .harness.json | 5 +---- composer.json | 2 +- src/Async/ArgumentNormalizer.php | 1 - src/Async/Async.php | 6 +++--- src/Async/CallableDescriptor.php | 1 - src/Domain/Service/AbstractHook.php | 4 +--- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/harness.yml b/.github/workflows/harness.yml index 623ab53..ad6e301 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.6 + uses: Pollora/harness/.github/workflows/php-package.yml@v0.1.8 permissions: contents: read diff --git a/.harness.json b/.harness.json index 1e2f1a1..02f328e 100644 --- a/.harness.json +++ b/.harness.json @@ -7,8 +7,5 @@ "ratchet": { "phpstan_level": 5, "phpstan_baseline": 0 - }, - "observed": [ - "Rector" - ] + } } diff --git a/composer.json b/composer.json index cbdf932..1d53291 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "mockery/mockery": "^1.6", "pestphp/pest": "^v3.8.2", "phpstan/phpstan": "^2.1.16", - "pollora/harness": "^0.1.6", + "pollora/harness": "^0.1.8", "szepeviktor/phpstan-wordpress": "^2.0" }, "suggest": { diff --git a/src/Async/ArgumentNormalizer.php b/src/Async/ArgumentNormalizer.php index 9885d52..cb0f271 100644 --- a/src/Async/ArgumentNormalizer.php +++ b/src/Async/ArgumentNormalizer.php @@ -184,7 +184,6 @@ private function denormalizeDate(array $value): \DateTimeInterface $class = \DateTimeImmutable::class; } - /** @var \DateTime|\DateTimeImmutable $date */ $date = new $class((string) $value['value']); return $date->setTimezone(new \DateTimeZone((string) $value['timezone'])); diff --git a/src/Async/Async.php b/src/Async/Async.php index aa1e13e..ba2be9f 100644 --- a/src/Async/Async.php +++ b/src/Async/Async.php @@ -437,7 +437,7 @@ public static function report(string|\Throwable $incident, array $context = []): return; } - $details = array_filter($context, fn (mixed $value): bool => is_scalar($value)); + $details = array_filter($context, is_scalar(...)); error_log('[pollora/hook] '.$message.($details === [] ? '' : ' '.json_encode($details))); } @@ -524,8 +524,8 @@ private static function normalizer(): ArgumentNormalizer private static function factories(): array { return self::$factories + [ - 'action-scheduler' => static fn (): AsyncDriver => ScheduledDriver::actionScheduler(), - 'wp-cron' => static fn (): AsyncDriver => ScheduledDriver::wpCron(), + 'action-scheduler' => ScheduledDriver::actionScheduler(...), + 'wp-cron' => ScheduledDriver::wpCron(...), 'sync' => static fn (): AsyncDriver => new SyncDriver, ]; } diff --git a/src/Async/CallableDescriptor.php b/src/Async/CallableDescriptor.php index 629cefb..018473d 100644 --- a/src/Async/CallableDescriptor.php +++ b/src/Async/CallableDescriptor.php @@ -138,7 +138,6 @@ public function resolve(string $descriptor): callable throw UnresolvableHandler::notInstantiable($className, $throwable); } - /** @var callable */ return [$instance, $method]; } diff --git a/src/Domain/Service/AbstractHook.php b/src/Domain/Service/AbstractHook.php index e7f1367..9996729 100644 --- a/src/Domain/Service/AbstractHook.php +++ b/src/Domain/Service/AbstractHook.php @@ -397,9 +397,7 @@ protected function addHookEvent(string $hook, callable|string|array $callback, i ]; // Make sure the hook array exists - if (! isset($this->hooks[$hook])) { - $this->hooks[$hook] = []; - } + $this->hooks[$hook] ??= []; // Add this hook data to the array $this->hooks[$hook][] = $hookData;