Skip to content

Commit

Permalink
fixup! feat(polls): allow editing of draft polls
Browse files Browse the repository at this point in the history
  • Loading branch information
miaulalala committed Jan 16, 2025
1 parent 99ef25e commit 9a8e5d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/PollController.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public function votePoll(int $pollId, array $optionIds = []): DataResponse {
*
* @param int $pollId ID of the poll
* @psalm-param non-negative-int $pollId
* @return DataResponse<Http::STATUS_OK, TalkPoll, array{}>|DataResponse<Http::STATUS_ACCEPTED, null, array{}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array{error: 'poll'}, array{}>
* @return DataResponse<Http::STATUS_OK, TalkPoll, array{}>|DataResponse<Http::STATUS_ACCEPTED, null, array{}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array{error: 'draft'|'options'|'poll'|'question'|'room'}, array{}>

Check failure on line 349 in lib/Controller/PollController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

MoreSpecificReturnType

lib/Controller/PollController.php:349:13: MoreSpecificReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<200|400|403|404, array{actorDisplayName?: string, actorId?: non-empty-string, actorType?: 'bots'|'bridged'|'circles'|'emails'|'federated_users'|'groups'|'guests'|'phones'|'users', details?: list<array{actorDisplayName: string, actorId: string, actorType: string, optionId: int}>, error?: 'draft'|'options'|'poll'|'question'|'room', id?: int<1, max>, maxVotes?: int<0, max>, numVoters?: int<0, max>, options?: list<string>, question?: non-empty-string, resultMode?: 0|1, status?: 0|1|2, votedSelf?: list<int>, votes?: array<string, int>}, array<never, never>>|OCP\AppFramework\Http\DataResponse<202, null, array<never, never>>' for OCA\Talk\Controller\PollController::closePoll is more specific than the inferred return type 'OCP\AppFramework\Http\DataResponse<200|400|403|404, array{actorDisplayName?: string, actorId?: non-empty-string, actorType?: 'bots'|'bridged'|'circles'|'emails'|'federated_users'|'groups'|'guests'|'phones'|'users', details?: list<array{actorDisplayName: string, actorId: string, actorType: string, optionId: int}>, error?: string, id?: int<1, max>, maxVotes?: int<0, max>, numVoters?: int<0, max>, options?: list<string>, question?: non-empty-string, resultMode?: 0|1, status?: 0|1|2, votedSelf?: list<int>, votes?: array<string, int>}, array<never, never>>|OCP\AppFramework\Http\DataResponse<202, null, array<never, never>>' (see https://psalm.dev/070)
*
* 200: Poll closed successfully
* 202: Poll draft was deleted successfully
Expand Down
4 changes: 2 additions & 2 deletions lib/Federation/Proxy/TalkV1/Controller/PollController.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function createPoll(Room $room, Participant $participant, string $questio
}

/**
* @return DataResponse<Http::STATUS_OK, TalkPollDraft, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error: 'draft'|'options'|'question'|'room'}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{error: string}, array{}>
* @return DataResponse<Http::STATUS_OK, TalkPollDraft, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error: 'draft'|'options'|'poll'|'question'|'room'}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{error: string}, array{}>
* @throws CannotReachRemoteException
*
* 200: Draft created successfully
Expand Down Expand Up @@ -211,7 +211,7 @@ public function updateDraftPoll(int $pollId, Room $room, Participant $participan
}

/**
* @return DataResponse<Http::STATUS_OK, TalkPoll, array{}>|DataResponse<Http::STATUS_ACCEPTED, null, array{}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array{error: 'poll'}|array{error: string}, array{}>
* @return DataResponse<Http::STATUS_OK, TalkPoll, array{}>|DataResponse<Http::STATUS_ACCEPTED, null, array{}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array{error: 'draft'|'options'|'poll'|'question'|'room'}|array{error: string}, array{}>
* @throws CannotReachRemoteException
*
* 200: Poll closed successfully
Expand Down

0 comments on commit 9a8e5d1

Please sign in to comment.