Skip to content

Commit 634c935

Browse files
authored
fix(transformers): force object type for properties (pterodactyl#4544)
1 parent c3521e0 commit 634c935

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/Transformers/Api/Client/ActivityLogTransformer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public function includeActor(ActivityLog $model)
4747
* Transforms any array values in the properties into a countable field for easier
4848
* use within the translation outputs.
4949
*/
50-
protected function properties(ActivityLog $model): array
50+
protected function properties(ActivityLog $model): object
5151
{
5252
if (!$model->properties || $model->properties->isEmpty()) {
53-
return [];
53+
return (object) [];
5454
}
5555

5656
$properties = $model->properties
@@ -76,7 +76,7 @@ protected function properties(ActivityLog $model): array
7676
$properties = $properties->merge(['count' => $properties->get($keys[0])])->except($keys[0]);
7777
}
7878

79-
return $properties->toArray();
79+
return (object) $properties->toArray();
8080
}
8181

8282
/**

0 commit comments

Comments
 (0)