Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/harness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions .harness.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"ratchet": {
"phpstan_level": 5,
"phpstan_baseline": 0
},
"observed": [
"Rector"
]
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion src/Async/ArgumentNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
Expand Down
6 changes: 3 additions & 3 deletions src/Async/Async.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}

Expand Down Expand Up @@ -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,
];
}
Expand Down
1 change: 0 additions & 1 deletion src/Async/CallableDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public function resolve(string $descriptor): callable
throw UnresolvableHandler::notInstantiable($className, $throwable);
}

/** @var callable */
return [$instance, $method];
}

Expand Down
4 changes: 1 addition & 3 deletions src/Domain/Service/AbstractHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading