fix type hint and add annotations
Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
Родитель
da7b50139b
Коммит
5053d4fa92
|
@ -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))];
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче