diff --git a/lib/Controller/PublicController.php b/lib/Controller/PublicController.php index 12130dad6..28dd0feb4 100644 --- a/lib/Controller/PublicController.php +++ b/lib/Controller/PublicController.php @@ -207,7 +207,7 @@ class PublicController extends Controller { */ public function getVotes(string $token): DataResponse { return $this->response(function () use ($token) { - return ['votes' =>AnonymizeService::replaceUserId($this->voteService->list(0, $token))]; + return ['votes' => AnonymizeService::replaceUserId($this->voteService->list(0, $token))]; }); } diff --git a/lib/Service/AnonymizeService.php b/lib/Service/AnonymizeService.php index 6e396b56f..b3eae276a 100644 --- a/lib/Service/AnonymizeService.php +++ b/lib/Service/AnonymizeService.php @@ -117,9 +117,11 @@ class AnonymizeService { } /** - * Replaces userIds with displayName to avoid exposing usernames in public polls + * * Replaces userIds with displayName to avoid exposing usernames in public polls + * + * @param (Comment|Option|Poll|Vote)[]|Comment|Option|Poll|Vote $arrayOrObject */ - public static function replaceUserId(mixed $arrayOrObject) { + public static function replaceUserId($arrayOrObject) { if (is_array($arrayOrObject)) { foreach ($arrayOrObject as $item) { if ($item instanceof Comment || $item instanceof Vote) {