diff --git a/composer.lock b/composer.lock index 730b089c9df..97de701f325 100644 --- a/composer.lock +++ b/composer.lock @@ -306,12 +306,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "3dfbf63feaf67f0634622b949a5eec46be3e246d" + "reference": "75fdb04d94e614ec08f1b7322b9fd64889655dab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/3dfbf63feaf67f0634622b949a5eec46be3e246d", - "reference": "3dfbf63feaf67f0634622b949a5eec46be3e246d", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/75fdb04d94e614ec08f1b7322b9fd64889655dab", + "reference": "75fdb04d94e614ec08f1b7322b9fd64889655dab", "shasum": "" }, "require": { @@ -343,7 +343,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2024-10-30T00:43:43+00:00" + "time": "2024-11-18T10:21:20+00:00" }, { "name": "psr/clock", @@ -1280,8 +1280,8 @@ }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "platform-overrides": { "php": "8.1" }, diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php index 3c0c10b3cd5..5e26b0da37b 100644 --- a/lib/Controller/ChatController.php +++ b/lib/Controller/ChatController.php @@ -85,6 +85,7 @@ * @psalm-import-type TalkChatMessage from ResponseDefinitions * @psalm-import-type TalkChatMessageWithParent from ResponseDefinitions * @psalm-import-type TalkChatReminder from ResponseDefinitions + * @psalm-import-type TalkRichObjectParameter from ResponseDefinitions * @psalm-import-type TalkRoom from ResponseDefinitions */ class ChatController extends AEnvironmentAwareController { @@ -289,8 +290,10 @@ public function shareObjectToChat(string $objectType, string $objectId, string $ return new DataResponse([], Http::STATUS_NOT_FOUND); } + /** @var TalkRichObjectParameter $data */ $data = $metaData !== '' ? json_decode($metaData, true) : []; if (!is_array($data)) { + /** @var TalkRichObjectParameter $data */ $data = []; } $data['type'] = $objectType; diff --git a/lib/Dashboard/TalkWidget.php b/lib/Dashboard/TalkWidget.php index 94cc52ebf07..89478c584d2 100644 --- a/lib/Dashboard/TalkWidget.php +++ b/lib/Dashboard/TalkWidget.php @@ -95,7 +95,7 @@ public function getWidgetOptions(): WidgetOptions { } /** - * @return \OCP\Dashboard\Model\WidgetButton[] + * @return list */ public function getWidgetButtons(string $userId): array { $buttons = []; diff --git a/lib/Model/AttachmentMapper.php b/lib/Model/AttachmentMapper.php index 2a56c0c4331..1ef2b6ce133 100644 --- a/lib/Model/AttachmentMapper.php +++ b/lib/Model/AttachmentMapper.php @@ -16,15 +16,12 @@ /** * @method Attachment mapRowToEntity(array $row) * @method Attachment findEntity(IQueryBuilder $query) - * @method Attachment[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class AttachmentMapper extends QBMapper { use TTransactional; - /** - * @param IDBConnection $db - */ public function __construct(IDBConnection $db) { parent::__construct($db, 'talk_attachments', Attachment::class); } @@ -42,11 +39,7 @@ public function createAttachmentFromRow(array $row): Attachment { } /** - * @param int $roomId - * @param string $objectType - * @param int $offset - * @param int $limit - * @return Attachment[] + * @return list * @throws \OCP\DB\Exception */ public function getAttachmentsByType(int $roomId, string $objectType, int $offset, int $limit): array { diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index 100f1a7a5b1..b3e73c5c582 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -18,22 +18,15 @@ /** * @method Attendee mapRowToEntity(array $row) * @method Attendee findEntity(IQueryBuilder $query) - * @method Attendee[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class AttendeeMapper extends QBMapper { - /** - * @param IDBConnection $db - */ public function __construct(IDBConnection $db) { parent::__construct($db, 'talk_attendees', Attendee::class); } /** - * @param int $roomId - * @param string $actorType - * @param string $actorId - * @return Attendee * @throws DoesNotExistException */ public function findByActor(int $roomId, string $actorType, string $actorId): Attendee { @@ -48,11 +41,8 @@ public function findByActor(int $roomId, string $actorType, string $actorId): At } /** - * @param int $id - * @return Attendee * @throws DoesNotExistException * @throws MultipleObjectsReturnedException - * @throws DBException */ public function getById(int $id): Attendee { $query = $this->db->getQueryBuilder(); @@ -64,10 +54,6 @@ public function getById(int $id): Attendee { } /** - * @param int $id - * @param string $token - * @return Attendee - * @throws DBException * @throws DoesNotExistException * @throws MultipleObjectsReturnedException */ @@ -82,10 +68,7 @@ public function getByRemoteIdAndToken(int $id, string $token): Attendee { } /** - * @param int $roomId - * @param string $actorType - * @param int|null $lastJoinedCall - * @return Attendee[] + * @return list */ public function getActorsByType(int $roomId, string $actorType, ?int $lastJoinedCall = null): array { $query = $this->db->getQueryBuilder(); @@ -102,10 +85,7 @@ public function getActorsByType(int $roomId, string $actorType, ?int $lastJoined } /** - * @param int $roomId - * @param array $actorTypes - * @param int|null $lastJoinedCall - * @return Attendee[] + * @return list */ public function getActorsByTypes(int $roomId, array $actorTypes, ?int $lastJoinedCall = null): array { $query = $this->db->getQueryBuilder(); @@ -122,9 +102,7 @@ public function getActorsByTypes(int $roomId, array $actorTypes, ?int $lastJoine } /** - * @param int $roomId - * @param array $participantType - * @return Attendee[] + * @return list * @throws DBException */ public function getActorsByParticipantTypes(int $roomId, array $participantType): array { @@ -140,12 +118,6 @@ public function getActorsByParticipantTypes(int $roomId, array $participantType) return $this->findEntities($query); } - /** - * @param int $roomId - * @param string $actorType - * @param int|null $lastJoinedCall - * @return int - */ public function getActorsCountByType(int $roomId, string $actorType, ?int $lastJoinedCall = null): int { $query = $this->db->getQueryBuilder(); $query->select($query->func()->count('*', 'num_actors')) @@ -165,9 +137,7 @@ public function getActorsCountByType(int $roomId, string $actorType, ?int $lastJ } /** - * @param int $roomId * @param int[] $participantType - * @return int */ public function countActorsByParticipantType(int $roomId, array $participantType): int { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/BanMapper.php b/lib/Model/BanMapper.php index 52f52aff9f5..4662a87cc85 100644 --- a/lib/Model/BanMapper.php +++ b/lib/Model/BanMapper.php @@ -16,7 +16,7 @@ /** * @method Ban mapRowToEntity(array $row) * @method Ban findEntity(IQueryBuilder $query) - * @method Ban[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class BanMapper extends QBMapper { diff --git a/lib/Model/BotConversationMapper.php b/lib/Model/BotConversationMapper.php index 3274c52f24c..445c9f2e1f7 100644 --- a/lib/Model/BotConversationMapper.php +++ b/lib/Model/BotConversationMapper.php @@ -16,7 +16,7 @@ /** * @method BotConversation mapRowToEntity(array $row) * @method BotConversation findEntity(IQueryBuilder $query) - * @method BotConversation[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class BotConversationMapper extends QBMapper { @@ -29,7 +29,7 @@ public function __construct( } /** - * @return BotConversation[] + * @return list */ public function findForToken(string $token): array { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/BotServerMapper.php b/lib/Model/BotServerMapper.php index eca6dfaaedf..0db8508b045 100644 --- a/lib/Model/BotServerMapper.php +++ b/lib/Model/BotServerMapper.php @@ -17,7 +17,7 @@ /** * @method BotServer mapRowToEntity(array $row) * @method BotServer findEntity(IQueryBuilder $query) - * @method BotServer[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class BotServerMapper extends QBMapper { @@ -84,7 +84,7 @@ public function deleteById(int $botId): int { } /** - * @return BotServer[] + * @return list */ public function findByIds(array $botIds): array { $query = $this->db->getQueryBuilder(); @@ -96,7 +96,7 @@ public function findByIds(array $botIds): array { } /** - * @return BotServer[] + * @return list */ public function getAllBots(): array { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/ConsentMapper.php b/lib/Model/ConsentMapper.php index cebbceba573..474943e050a 100644 --- a/lib/Model/ConsentMapper.php +++ b/lib/Model/ConsentMapper.php @@ -15,7 +15,7 @@ /** * @method Consent mapRowToEntity(array $row) * @method Consent findEntity(IQueryBuilder $query) - * @method Consent[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class ConsentMapper extends QBMapper { @@ -26,7 +26,7 @@ public function __construct( } /** - * @return Consent[] + * @return list */ public function findForToken(string $token): array { $query = $this->db->getQueryBuilder(); @@ -46,7 +46,7 @@ public function deleteByToken(string $token): int { } /** - * @return Consent[] + * @return list */ public function findForActor(string $actorType, string $actorId): array { $query = $this->db->getQueryBuilder(); @@ -68,7 +68,7 @@ public function deleteByActor(string $actorType, string $actorId): int { } /** - * @return Consent[] + * @return list */ public function findForTokenByActor(string $token, string $actorType, string $actorId): array { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/InvitationMapper.php b/lib/Model/InvitationMapper.php index b64a33f090a..07b9197506c 100644 --- a/lib/Model/InvitationMapper.php +++ b/lib/Model/InvitationMapper.php @@ -23,7 +23,7 @@ * * @method Invitation mapRowToEntity(array $row) * @method Invitation findEntity(IQueryBuilder $query) - * @method Invitation[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class InvitationMapper extends QBMapper { @@ -66,7 +66,7 @@ public function getByRemoteAndAccessToken( /** * @param IUser $user - * @return Invitation[] + * @return list */ public function getInvitationsForUser(IUser $user): array { $qb = $this->db->getQueryBuilder(); diff --git a/lib/Model/PollMapper.php b/lib/Model/PollMapper.php index ee59e9937a3..5e4e311a98f 100644 --- a/lib/Model/PollMapper.php +++ b/lib/Model/PollMapper.php @@ -12,23 +12,21 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\AppFramework\Db\QBMapper; -use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; /** + * @method Poll findEntity(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class PollMapper extends QBMapper { - /** - * @param IDBConnection $db - */ public function __construct(IDBConnection $db) { parent::__construct($db, 'talk_polls', Poll::class); } /** - * @return Poll[] + * @return list */ public function getDraftsByRoomId(int $roomId): array { $query = $this->db->getQueryBuilder(); @@ -43,11 +41,8 @@ public function getDraftsByRoomId(int $roomId): array { } /** - * @param int $pollId - * @return Poll * @throws DoesNotExistException * @throws MultipleObjectsReturnedException - * @throws Exception */ public function getByPollId(int $pollId): Poll { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/ProxyCacheMessageMapper.php b/lib/Model/ProxyCacheMessageMapper.php index 23480fbc545..e60dc13498c 100644 --- a/lib/Model/ProxyCacheMessageMapper.php +++ b/lib/Model/ProxyCacheMessageMapper.php @@ -19,7 +19,7 @@ /** * @method ProxyCacheMessage mapRowToEntity(array $row) * @method ProxyCacheMessage findEntity(IQueryBuilder $query) - * @method ProxyCacheMessage[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class ProxyCacheMessageMapper extends QBMapper { diff --git a/lib/Model/ReminderMapper.php b/lib/Model/ReminderMapper.php index 8fa97ceaf75..1864dbbb160 100644 --- a/lib/Model/ReminderMapper.php +++ b/lib/Model/ReminderMapper.php @@ -17,7 +17,7 @@ /** * @method Reminder mapRowToEntity(array $row) * @method Reminder findEntity(IQueryBuilder $query) - * @method Reminder[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class ReminderMapper extends QBMapper { @@ -44,7 +44,7 @@ public function findForUserAndMessage(string $userId, string $token, int $messag } /** - * @return Reminder[] + * @return list */ public function findRemindersToExecute(\DateTime $dateTime): array { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/RetryNotificationMapper.php b/lib/Model/RetryNotificationMapper.php index 40b851dd087..2a904361a2d 100644 --- a/lib/Model/RetryNotificationMapper.php +++ b/lib/Model/RetryNotificationMapper.php @@ -15,7 +15,7 @@ /** * @method RetryNotification mapRowToEntity(array $row) * @method RetryNotification findEntity(IQueryBuilder $query) - * @method RetryNotification[] findEntities(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class RetryNotificationMapper extends QBMapper { @@ -26,7 +26,7 @@ public function __construct( } /** - * @return RetryNotification[] + * @return list */ public function getAllDue(\DateTimeInterface $dueDateTime, ?int $limit = 500): array { $query = $this->db->getQueryBuilder(); diff --git a/lib/Model/SessionMapper.php b/lib/Model/SessionMapper.php index 553dd62088a..78c445c8a09 100644 --- a/lib/Model/SessionMapper.php +++ b/lib/Model/SessionMapper.php @@ -9,26 +9,24 @@ namespace OCA\Talk\Model; use OCA\Talk\Participant; +use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\QBMapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; /** * @method Session mapRowToEntity(array $row) + * @method Session findEntity(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class SessionMapper extends QBMapper { - /** - * @param IDBConnection $db - */ public function __construct(IDBConnection $db) { parent::__construct($db, 'talk_sessions', Session::class); } /** - * @param string $sessionId - * @return Session - * @throws \OCP\AppFramework\Db\DoesNotExistException + * @throws DoesNotExistException */ public function findBySessionId(string $sessionId): Session { $query = $this->db->getQueryBuilder(); @@ -40,8 +38,7 @@ public function findBySessionId(string $sessionId): Session { } /** - * @param int $attendeeId - * @return Session[] + * @return list */ public function findByAttendeeId(int $attendeeId): array { $query = $this->db->getQueryBuilder(); @@ -53,7 +50,6 @@ public function findByAttendeeId(int $attendeeId): array { } /** - * @param int $attendeeId * @return int Number of deleted entities */ public function deleteByAttendeeId(int $attendeeId): int { diff --git a/lib/Model/VoteMapper.php b/lib/Model/VoteMapper.php index 24a587d0e5b..08d0709c357 100644 --- a/lib/Model/VoteMapper.php +++ b/lib/Model/VoteMapper.php @@ -14,19 +14,17 @@ use OCP\IDBConnection; /** + * @method Vote findEntity(IQueryBuilder $query) + * @method list findEntities(IQueryBuilder $query) * @template-extends QBMapper */ class VoteMapper extends QBMapper { - /** - * @param IDBConnection $db - */ public function __construct(IDBConnection $db) { parent::__construct($db, 'talk_poll_votes', Vote::class); } /** - * @param int $pollId - * @return Vote[] + * @return list */ public function findByPollId(int $pollId): array { $query = $this->db->getQueryBuilder(); @@ -38,10 +36,7 @@ public function findByPollId(int $pollId): array { } /** - * @param int $pollId - * @param string $actorType - * @param string $actorId - * @return Vote[] + * @return list */ public function findByPollIdForActor(int $pollId, string $actorType, string $actorId): array { $query = $this->db->getQueryBuilder();