From 9534481c10b8bf10dccea623aa3a16e782226550 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 10 Nov 2023 13:22:48 +0100 Subject: [PATCH] fix(API): Add more specific int-types Signed-off-by: Joas Schilling --- lib/Controller/BreakoutRoomController.php | 7 +++- lib/Controller/CallController.php | 7 +++- lib/Controller/ChatController.php | 33 ++++++++++----- lib/Controller/FederationController.php | 2 + lib/Controller/PollController.php | 7 +++- lib/Controller/ReactionController.php | 3 ++ lib/Controller/RecordingController.php | 5 +++ lib/Controller/RoomController.php | 49 ++++++++++++++++------- lib/Controller/SignalingController.php | 1 + lib/Service/BreakoutRoomService.php | 4 +- 10 files changed, 88 insertions(+), 30 deletions(-) diff --git a/lib/Controller/BreakoutRoomController.php b/lib/Controller/BreakoutRoomController.php index 492f62342fad..297d92531973 100644 --- a/lib/Controller/BreakoutRoomController.php +++ b/lib/Controller/BreakoutRoomController.php @@ -30,6 +30,7 @@ use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Middleware\Attribute\RequireLoggedInModeratorParticipant; use OCA\Talk\Middleware\Attribute\RequireLoggedInParticipant; +use OCA\Talk\Model\BreakoutRoom; use OCA\Talk\ResponseDefinitions; use OCA\Talk\Service\BreakoutRoomService; use OCA\Talk\Service\ParticipantService; @@ -58,8 +59,10 @@ public function __construct( /** * Configure the breakout rooms * - * @param int $mode Mode of the breakout rooms - * @param int $amount Number of breakout rooms + * @param 0|1|2|3 $mode Mode of the breakout rooms + * @psalm-param BreakoutRoom::MODE_* $mode + * @param 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20 $amount Number of breakout rooms + * @psalm-param int<1, 20> $amount Constants {@see BreakoutRoom::MINIMUM_ROOM_AMOUNT} and {@see BreakoutRoom::MAXIMUM_ROOM_AMOUNT} * @param string $attendeeMap Mapping of the attendees to breakout rooms * @return DataResponse|DataResponse * diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php index 1df85d601fba..fb3a038f65c6 100644 --- a/lib/Controller/CallController.php +++ b/lib/Controller/CallController.php @@ -119,8 +119,10 @@ public function getPeersForCall(): DataResponse { /** * Join a call * - * @param int|null $flags In-Call flags - * @param int|null $forcePermissions In-call permissions + * @param 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|null $flags In-Call flags + * @psalm-param int-mask-of|null $flags + * @param 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255|null $forcePermissions In-call permissions + * @psalm-param int-mask-of|null $forcePermissions * @param bool $silent Join the call silently * @param bool $recordingConsent When the user ticked a checkbox and agreed with being recorded * (Only needed when the `config => call => recording-consent` capability is set to {@see RecordingService::CONSENT_REQUIRED_YES} @@ -248,6 +250,7 @@ public function sipDialOut(int $attendeeId): DataResponse { * Update the in-call flags * * @param int $flags New flags + * @psalm-param int-mask-of $flags New flags * @return DataResponse, array{}> * * 200: In-call flags updated successfully diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php index 0233bbea43b7..18b21c97c8db 100644 --- a/lib/Controller/ChatController.php +++ b/lib/Controller/ChatController.php @@ -177,6 +177,7 @@ protected function parseCommentToResponse(IComment $comment, Message $parentMess * @param string $actorDisplayName for guests * @param string $referenceId for the message to be able to later identify it again * @param int $replyTo Parent id which this message is a reply to + * @psalm-param non-negative-int $replyTo * @param bool $silent If sent silent the chat message will not create any notifications * @return DataResponse|DataResponse, array{}> * @@ -361,18 +362,21 @@ protected function preloadShares(array $comments): void { * returned, but it should be used nevertheless as the $lastKnownMessageId * for the follow-up query. * - * @param int $lookIntoFuture Polling for new messages (1) or getting the history of the chat (0) + * @param 0|1 $lookIntoFuture Polling for new messages (1) or getting the history of the chat (0) * @param int $limit Number of chat messages to receive (100 by default, 200 at most) * @param int $lastKnownMessageId The last known message (serves as offset) + * @psalm-param non-negative-int $lastKnownMessageId * @param int $lastCommonReadId The last known common read message * (so the response is 200 instead of 304 when * it changes even when there are no messages) - * @param int $timeout Number of seconds to wait for new messages (30 by default, 30 at most) - * @param int $setReadMarker Automatically set the last read marker when 1, + * @psalm-param non-negative-int $lastCommonReadId + * @param 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30 $timeout Number of seconds to wait for new messages (30 by default, 30 at most) + * @psalm-param int<0, 30> $timeout + * @param 0|1 $setReadMarker Automatically set the last read marker when 1, * if your client does this itself via chat/{token}/read set to 0 - * @param int $includeLastKnown Include the $lastKnownMessageId in the messages when 1 (default 0) - * @param int $noStatusUpdate When the user status should not be automatically set to online set to 1 (default 0) - * @param int $markNotificationsAsRead Set to 0 when notifications should not be marked as read (default 1) + * @param 0|1 $includeLastKnown Include the $lastKnownMessageId in the messages when 1 (default 0) + * @param 0|1 $noStatusUpdate When the user status should not be automatically set to online set to 1 (default 0) + * @param 0|1 $markNotificationsAsRead Set to 0 when notifications should not be marked as read (default 1) * @return DataResponse * * 200: Messages returned @@ -581,7 +585,9 @@ protected function prepareCommentsAsDataResponse(array $comments, int $lastCommo * Get the context of a message * * @param int $messageId The focused message which should be in the "middle" of the returned context - * @param int $limit Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages) + * @psalm-param non-negative-int $messageId + * @param 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100 $limit Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages) + * @psalm-param int<1, 100> $limit * @return DataResponse * * 200: Message context returned @@ -651,6 +657,7 @@ protected function loadSelfReactions(array $messages, array $commentIdToIndex): * Delete a chat message * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @return DataResponse|DataResponse, array{}> * * 200: Message deleted successfully @@ -732,7 +739,9 @@ public function deleteMessage(int $messageId): DataResponse { * Set a reminder for a chat message * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @param int $timestamp Timestamp of the reminder + * @psalm-param non-negative-int $timestamp * @return DataResponse|DataResponse, array{}> * * 201: Reminder created successfully @@ -763,6 +772,7 @@ public function setReminder(int $messageId, int $timestamp): DataResponse { * Get the reminder for a chat message * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @return DataResponse|DataResponse, array{}> * * 200: Reminder returned @@ -794,6 +804,7 @@ public function getReminder(int $messageId): DataResponse { * Delete a chat reminder * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @return DataResponse, array{}> * * 200: Reminder deleted successfully @@ -864,6 +875,7 @@ public function clearHistory(): DataResponse { * Set the read marker to a specific message * * @param int $lastReadMessage ID if the last read message + * @psalm-param non-negative-int $lastReadMessage * @return DataResponse, array{X-Chat-Last-Common-Read?: numeric-string}> * * 200: Read marker set successfully @@ -913,7 +925,8 @@ public function markUnread(): DataResponse { /** * Get objects that are shared in the room overview * - * @param int $limit Maximum number of objects + * @param 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20 $limit Maximum number of objects + * @psalm-param int<1, 20> $limit * @return DataResponse, array{}> * * 200: List of shared objects messages of each type returned @@ -965,7 +978,9 @@ public function getObjectsSharedInRoomOverview(int $limit = 7): DataResponse { * * @param string $objectType Type of the objects * @param int $lastKnownMessageId ID of the last known message - * @param int $limit Maximum number of objects + * @psalm-param non-negative-int $lastKnownMessageId + * @param 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200 $limit Maximum number of objects + * @psalm-param int<1, 200> $limit * @return DataResponse * * 200: List of shared objects messages returned diff --git a/lib/Controller/FederationController.php b/lib/Controller/FederationController.php index 9d4aeb4c12eb..0ef6c32d8f35 100644 --- a/lib/Controller/FederationController.php +++ b/lib/Controller/FederationController.php @@ -65,6 +65,7 @@ public function __construct( * Accept a federation invites * * @param int $id ID of the share + * @psalm-param non-negative-int $id * @return DataResponse, array{}> * @throws UnauthorizedException * @throws DBException @@ -86,6 +87,7 @@ public function acceptShare(int $id): DataResponse { * Decline a federation invites * * @param int $id ID of the share + * @psalm-param non-negative-int $id * @return DataResponse, array{}> * @throws UnauthorizedException * @throws DBException diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php index 517de228bf82..762529e08e3a 100644 --- a/lib/Controller/PollController.php +++ b/lib/Controller/PollController.php @@ -71,7 +71,9 @@ public function __construct( * * @param string $question Question of the poll * @param string[] $options Options of the poll - * @param int $resultMode Mode how the results will be shown + * @psalm-param list $options + * @param 0|1 $resultMode Mode how the results will be shown + * @psalm-param Poll::MODE_* $resultMode Mode how the results will be shown * @param int $maxVotes Number of maximum votes per voter * @return DataResponse|DataResponse, array{}> * @@ -132,6 +134,7 @@ public function createPoll(string $question, array $options, int $resultMode, in * Get a poll * * @param int $pollId ID of the poll + * @psalm-param non-negative-int $pollId * @return DataResponse|DataResponse, array{}> * * 200: Poll returned @@ -160,6 +163,7 @@ public function showPoll(int $pollId): DataResponse { * Vote on a poll * * @param int $pollId ID of the poll + * @psalm-param non-negative-int $pollId * @param int[] $optionIds IDs of the selected options * @return DataResponse|DataResponse, array{}> * @@ -213,6 +217,7 @@ public function votePoll(int $pollId, array $optionIds = []): DataResponse { * Close a poll * * @param int $pollId ID of the poll + * @psalm-param non-negative-int $pollId * @return DataResponse|DataResponse, array{}> * * 200: Poll closed successfully diff --git a/lib/Controller/ReactionController.php b/lib/Controller/ReactionController.php index 684f9f6dd298..8ba20cc8c401 100644 --- a/lib/Controller/ReactionController.php +++ b/lib/Controller/ReactionController.php @@ -58,6 +58,7 @@ public function __construct( * Add a reaction to a message * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @param string $reaction Emoji to add * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> * @@ -96,6 +97,7 @@ public function react(int $messageId, string $reaction): DataResponse { * Delete a reaction from a message * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @param string $reaction Emoji to remove * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> * @@ -131,6 +133,7 @@ public function delete(int $messageId, string $reaction): DataResponse { * Get a list of reactions for a message * * @param int $messageId ID of the message + * @psalm-param non-negative-int $messageId * @param string|null $reaction Emoji to filter * @return DataResponse|\stdClass, array{}>|DataResponse, array{}> * diff --git a/lib/Controller/RecordingController.php b/lib/Controller/RecordingController.php index 5f5d686a1325..bfc30ab01d4d 100644 --- a/lib/Controller/RecordingController.php +++ b/lib/Controller/RecordingController.php @@ -71,6 +71,7 @@ public function __construct( * Get the welcome message of a recording server * * @param int $serverId ID of the server + * @psalm-param non-negative-int $serverId * @return DataResponse|DataResponse, array{}>|DataResponse * * 200: Welcome message returned @@ -318,6 +319,7 @@ private function backendFailed(array $failed): DataResponse { * Start the recording * * @param int $status Type of the recording + * @psalm-param Room::RECORDING_* $status * @return DataResponse, array{}>|DataResponse * * 200: Recording started successfully @@ -394,6 +396,7 @@ public function store(string $owner): DataResponse { * Dismiss the store call recording notification * * @param int $timestamp Timestamp of the notification to be dismissed + * @psalm-param non-negative-int $timestamp * @return DataResponse, array{}>|DataResponse * * 200: Notification dismissed successfully @@ -418,7 +421,9 @@ public function notificationDismiss(int $timestamp): DataResponse { * Share the recorded file to the chat * * @param int $fileId ID of the file + * @psalm-param non-negative-int $fileId * @param int $timestamp Timestamp of the notification to be dismissed + * @psalm-param non-negative-int $timestamp * @return DataResponse, array{}>|DataResponse * * 200: Recording shared to chat successfully diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index e93a01ae3531..671cc1221973 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -164,9 +164,10 @@ protected function getTalkHashHeader(): array { /** * Get all currently existent rooms which the user has joined * - * @param int $noStatusUpdate When the user status should not be automatically set to online set to 1 (default 0) + * @param 0|1 $noStatusUpdate When the user status should not be automatically set to online set to 1 (default 0) * @param bool $includeStatus Include the user status * @param int $modifiedSince Filter rooms modified after a timestamp + * @psalm-param non-negative-int $modifiedSince * @return DataResponse * * 200: Return list of rooms @@ -451,9 +452,10 @@ protected function formatRoom(Room $room, ?Participant $currentParticipant, ?arr * Create a room with a user, a group or a circle * * @param int $roomType Type of the room + * @psalm-param Room::TYPE_* $roomType * @param string $invite User, group, … ID to invite * @param string $roomName Name of the room - * @param string $source Source of the invite ID ('circles' to create a room with a circle, etc.) + * @param 'groups'|'circles' $source Source of the invite ID ('circles' to create a room with a circle, etc.) * @param string $objectType Type of the object * @param string $objectId ID of the object * @return DataResponse|DataResponse|DataResponse, array{}> @@ -697,6 +699,7 @@ public function removeFromFavorites(): DataResponse { * Update the notification level for a room * * @param int $level New level + * @psalm-param Participant::NOTIFY_* $level * @return DataResponse, array{}> * * 200: Notification level updated successfully @@ -718,6 +721,7 @@ public function setNotificationLevel(int $level): DataResponse { * Update call notifications * * @param int $level New level + * @psalm-param Participant::NOTIFY_CALLS_* $level * @return DataResponse, array{}> * * 200: Call notification level updated successfully @@ -1020,7 +1024,7 @@ protected function formatParticipantList(array $participants, bool $includeStatu * Add a participant to a room * * @param string $newParticipant New participant - * @param string $source Source of the participant + * @param 'users'|'groups'|'circles'|'emails'|'remotes'|'phones' $source Source of the participant * @return DataResponse, array{}>|DataResponse, array{}>|DataResponse * * 200: Participant successfully added @@ -1034,7 +1038,7 @@ public function addParticipantToRoom(string $newParticipant, string $source = 'u if ($this->room->getType() === Room::TYPE_ONE_TO_ONE || $this->room->getType() === Room::TYPE_ONE_TO_ONE_FORMER || $this->room->getType() === Room::TYPE_NOTE_TO_SELF - || $this->room->getObjectType() === 'share:password') { + || $this->room->getObjectType() === Room::OBJECT_TYPE_VIDEO_VERIFICATION) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } @@ -1260,6 +1264,7 @@ protected function removeSelfFromRoomLogic(Room $room, Participant $participant) * Remove an attendee from a room * * @param int $attendeeId ID of the attendee + * @psalm-param non-negative-int $attendeeId * @return DataResponse, array{}> * * 200: Attendee removed successfully @@ -1336,7 +1341,8 @@ public function makePrivate(): DataResponse { /** * Set read-only state of a room * - * @param int $state New read-only state + * @param 0|1 $state New read-only state + * @psalm-param Room::READ_* $state * @return DataResponse, array{}> * * 200: Read-only state updated successfully @@ -1364,7 +1370,8 @@ public function setReadOnly(int $state): DataResponse { /** * Make a room listable * - * @param int $scope Scope where the room is listable + * @param 0|1|2 $scope Scope where the room is listable + * @psalm-param Room::LISTABLE_* $scope * @return DataResponse, array{}> * * 200: Made room listable successfully @@ -1696,7 +1703,8 @@ public function rejectedDialOutRequest(string $callId, array $options = []): Dat /** * Set active state for a session * - * @param int $state of the room + * @param 0|1 $state of the room + * @psalm-param Session::STATE_* $state * @return DataResponse|DataResponse, array{}> * * 200: Session state set successfully @@ -1758,6 +1766,7 @@ public function leaveRoom(string $token): DataResponse { * Promote an attendee to moderator * * @param int $attendeeId ID of the attendee + * @psalm-param non-negative-int $attendeeId * @return DataResponse, array{}> * * 200: Attendee promoted to moderator successfully @@ -1775,6 +1784,7 @@ public function promoteModerator(int $attendeeId): DataResponse { * Demote an attendee from moderator * * @param int $attendeeId ID of the attendee + * @psalm-param non-negative-int $attendeeId * @return DataResponse, array{}> * * 200: Attendee demoted from moderator successfully @@ -1793,6 +1803,7 @@ public function demoteModerator(int $attendeeId): DataResponse { * attendeeId * * @param int $attendeeId + * @psalm-param non-negative-int $attendeeId * @param bool $promote Shall the attendee be promoted or demoted * @return DataResponse, array{}> */ @@ -1845,8 +1856,9 @@ protected function changeParticipantType(int $attendeeId, bool $promote): DataRe /** * Update the permissions of a room * - * @param string $mode Level of the permissions ('call', 'default') - * @param int $permissions New permissions + * @param 'call'|'default' $mode Level of the permissions ('call', 'default') + * @param 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255 $permissions New permissions + * @psalm-param int-mask-of $permissions * @return DataResponse|DataResponse, array{}> * * 200: Permissions updated successfully @@ -1866,8 +1878,10 @@ public function setPermissions(string $mode, int $permissions): DataResponse { * Update the permissions of an attendee * * @param int $attendeeId ID of the attendee - * @param string $method Method of updating permissions ('set', 'remove', 'add') - * @param int $permissions New permissions + * @psalm-param non-negative-int $attendeeId + * @param 'set'|'remove'|'add' $method Method of updating permissions ('set', 'remove', 'add') + * @param 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255 $permissions New permissions + * @psalm-param int-mask-of $permissions * @return DataResponse, array{}> * * 200: Permissions updated successfully @@ -1900,8 +1914,10 @@ public function setAttendeePermissions(int $attendeeId, string $method, int $per /** * Update the permissions of all attendees * - * @param string $method Method of updating permissions ('set', 'remove', 'add') - * @param int $permissions New permissions + * @param 'set'|'remove'|'add' $method Method of updating permissions ('set', 'remove', 'add') + * @psalm-param Attendee::PERMISSIONS_MODIFY_* $method + * @param 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255 $permissions New permissions + * @psalm-param int-mask-of $permissions * @return DataResponse|DataResponse, array{}> * * 200: Permissions updated successfully @@ -1921,7 +1937,9 @@ public function setAllAttendeesPermissions(string $method, int $permissions): Da * Update the lobby state for a room * * @param int $state New state + * @psalm-param Webinary::LOBBY_* $state * @param int|null $timer Timer when the lobby will be removed + * @psalm-param non-negative-int|null $timer * @return DataResponse|DataResponse, array{}> * * 200: Lobby state updated successfully @@ -1966,7 +1984,8 @@ public function setLobby(int $state, ?int $timer = null): DataResponse { /** * Update SIP enabled state * - * @param int $state New state + * @param 0|1|2 $state New state + * @psalm-param Webinary::SIP_* $state * @return DataResponse|DataResponse, array{}> * * 200: SIP enabled state updated successfully @@ -2030,6 +2049,7 @@ public function setRecordingConsent(int $recordingConsent): DataResponse { * Resend invitations * * @param int|null $attendeeId ID of the attendee + * @psalm-param non-negative-int|null $attendeeId * @return DataResponse, array{}> * * 200: Invitation resent successfully @@ -2066,6 +2086,7 @@ public function resendInvitations(?int $attendeeId): DataResponse { * Update message expiration time * * @param int $seconds New time + * @psalm-param non-negative-int $seconds * @return DataResponse, array{}>|DataResponse * * 200: Message expiration time updated successfully diff --git a/lib/Controller/SignalingController.php b/lib/Controller/SignalingController.php index fdac29d47914..3fff3f5807c1 100644 --- a/lib/Controller/SignalingController.php +++ b/lib/Controller/SignalingController.php @@ -228,6 +228,7 @@ public function getSettings(string $token = ''): DataResponse { * right now. * * @param int $serverId ID of the signaling server + * @psalm-param non-negative-int $serverId * @return DataResponse, array{}>|DataResponse, array{}>|DataResponse * * 200: Welcome message returned diff --git a/lib/Service/BreakoutRoomService.php b/lib/Service/BreakoutRoomService.php index 69de51469122..a7254b7fce3e 100644 --- a/lib/Service/BreakoutRoomService.php +++ b/lib/Service/BreakoutRoomService.php @@ -103,8 +103,8 @@ protected function parseAttendeeMap(string $map, int $max): array { /** * @param Room $parent - * @param int $mode - * @psalm-param 0|1|2|3 $mode + * @param 0|1|2|3 $mode + * @psalm-param BreakoutRoom::MODE_* $mode * @param int $amount * @param string $attendeeMap * @return Room[]