Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 6 additions & 5 deletions lib/Share/RoomShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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<array-key, non-empty-list<IShare>>
* @return array<int, list<IShare>>
* @psalm-return array<int, non-empty-list<IShare>>
*/
#[\Override]
public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true): array {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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<IShare>
* @since 18.0.0
*/
#[\Override]
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Chat/ChatManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading