From 634c9353e309c603064530824dfbb3c870a1f7b6 Mon Sep 17 00:00:00 2001 From: Devonte W Date: Mon, 21 Nov 2022 20:28:46 +0000 Subject: [PATCH] fix(transformers): force object type for properties (#4544) --- app/Transformers/Api/Client/ActivityLogTransformer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Transformers/Api/Client/ActivityLogTransformer.php b/app/Transformers/Api/Client/ActivityLogTransformer.php index 849fdc865..57c8ac30e 100644 --- a/app/Transformers/Api/Client/ActivityLogTransformer.php +++ b/app/Transformers/Api/Client/ActivityLogTransformer.php @@ -47,10 +47,10 @@ class ActivityLogTransformer extends BaseClientTransformer * Transforms any array values in the properties into a countable field for easier * use within the translation outputs. */ - protected function properties(ActivityLog $model): array + protected function properties(ActivityLog $model): object { if (!$model->properties || $model->properties->isEmpty()) { - return []; + return (object) []; } $properties = $model->properties @@ -76,7 +76,7 @@ class ActivityLogTransformer extends BaseClientTransformer $properties = $properties->merge(['count' => $properties->get($keys[0])])->except($keys[0]); } - return $properties->toArray(); + return (object) $properties->toArray(); } /**