From 56725154821af27179bf2a84a0dd0b0cacc9e0ae Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 15 Sep 2026 04:02:37 +0100 Subject: [PATCH] Maintenance: Addressed new phpstan issues --- app/Activity/Tools/WebhookFormatter.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Activity/Tools/WebhookFormatter.php b/app/Activity/Tools/WebhookFormatter.php index 111efd5d4..d5eedb567 100644 --- a/app/Activity/Tools/WebhookFormatter.php +++ b/app/Activity/Tools/WebhookFormatter.php @@ -57,8 +57,10 @@ class WebhookFormatter } /** + * @template TModel of Model + * * @param callable(string, Model):bool $condition - * @param callable(Model):void $format + * @param callable(TModel):void $format */ public function addModelFormatter(callable $condition, callable $format): void { @@ -73,7 +75,7 @@ class WebhookFormatter // Load entity owner, creator, updater details $this->addModelFormatter( fn ($event, $model) => ($model instanceof Entity), - function ($model) { + function (Entity $model) { $model->load(['ownedBy', 'createdBy', 'updatedBy']); } ); @@ -81,7 +83,7 @@ class WebhookFormatter // Load revision detail for page update and create events $this->addModelFormatter( fn ($event, $model) => ($model instanceof Page && ($event === ActivityType::PAGE_CREATE || $event === ActivityType::PAGE_UPDATE)), - function ($model) { + function (Page $model) { $model->load('currentRevision'); } );