diff --git a/composer.lock b/composer.lock index c0920f141d2..25abab0a359 100644 --- a/composer.lock +++ b/composer.lock @@ -334,12 +334,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "d42bd36d0413b881b7459b220e1328bc57e48b38" + "reference": "4a157cd2b3b339cc2529de578bddc1d2e4b77507" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/d42bd36d0413b881b7459b220e1328bc57e48b38", - "reference": "d42bd36d0413b881b7459b220e1328bc57e48b38", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/4a157cd2b3b339cc2529de578bddc1d2e4b77507", + "reference": "4a157cd2b3b339cc2529de578bddc1d2e4b77507", "shasum": "" }, "require": { @@ -375,7 +375,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2025-12-11T00:55:32+00:00" + "time": "2025-12-19T00:55:34+00:00" }, { "name": "psr/clock", diff --git a/lib/Chat/Parser/SystemMessage.php b/lib/Chat/Parser/SystemMessage.php index 4026ea172f1..358a004ac08 100644 --- a/lib/Chat/Parser/SystemMessage.php +++ b/lib/Chat/Parser/SystemMessage.php @@ -803,7 +803,7 @@ protected function parseDeletedMessage(Message $chatMessage): void { * @throws ShareNotFound */ protected function getFileFromShare(Room $room, ?Participant $participant, string $shareId, bool $allowInaccurate): array { - $share = $this->shareProvider->getShareById((int)$shareId); + $share = $this->shareProvider->getShareById($shareId); if ($participant && $participant->getAttendee()->getActorType() === Attendee::ACTOR_USERS) { if ($allowInaccurate) { diff --git a/lib/Share/RoomShareProvider.php b/lib/Share/RoomShareProvider.php index 09813cb642f..e4eeb1445c4 100644 --- a/lib/Share/RoomShareProvider.php +++ b/lib/Share/RoomShareProvider.php @@ -436,7 +436,7 @@ public function restore(IShare $share, string $recipient): IShare { $update->executeStatement(); - return $this->getShareById((int)$share->getId(), $recipient); + return $this->getShareById($share->getId(), $recipient); } /** @@ -507,8 +507,8 @@ public function move(IShare $share, $recipient): IShare { * @param Folder $node * @param bool $reshares Also get the shares where $user is the owner instead of just the shares where $user is the initiator * @param bool $shallow Whether the method should stop at the first level, or look into sub-folders. - * @return IShare[][] - * @psalm-return array> + * @return array> + * @psalm-return array> */ #[\Override] public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true): array { @@ -618,13 +618,14 @@ public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offs /** * Get share by id * - * @param int $id + * @param string $id * @param string|null $recipientId * @return IShare * @throws ShareNotFound */ #[\Override] public function getShareById($id, $recipientId = null): IShare { + $id = (int)$id; if (($recipientId === null) && isset($this->sharesByIdCache[$id])) { $share = $this->sharesByIdCache[$id]; } else { @@ -1167,7 +1168,7 @@ public function deleteInRoom(string $roomToken, ?string $user = null): void { * Get all the shares in this provider returned as iterable to reduce memory * overhead * - * @return iterable + * @return iterable * @since 18.0.0 */ #[\Override] diff --git a/tests/php/Chat/ChatManagerTest.php b/tests/php/Chat/ChatManagerTest.php index 19a29540a56..521eca75797 100644 --- a/tests/php/Chat/ChatManagerTest.php +++ b/tests/php/Chat/ChatManagerTest.php @@ -554,7 +554,7 @@ public function testDeleteMessageFileShare(): void { $this->shareManager->expects($this->once()) ->method('deleteShare') - ->willReturn($share); + ->with($share); $this->commentsManager->expects($this->once()) ->method('save')