Skip to content

Commit

Permalink
Fix or suppress remaining psalm issues
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Dec 21, 2023
1 parent 7554e63 commit 207e669
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/Mount/GroupFolderStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function getFolderId(): int {
return $this->folderId;
}

/**
* @psalm-suppress FalsableReturnStatement Return type of getOwner is not clear even in server
*/
public function getOwner($path) {
$user = $this->userSession->getUser();
if ($user !== null) {
Expand All @@ -70,7 +73,7 @@ public function getCache($path = '', $storage = null) {
}

public function getScanner($path = '', $storage = null) {
/** @var \OC\Files\Storage\Storage $storage */
/** @var \OC\Files\Storage\Wrapper\Wrapper $storage */
if (!$storage) {
$storage = $this;
}
Expand Down
1 change: 1 addition & 0 deletions lib/Versions/ExpireManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ protected function getAutoExpireList(int $time, array $versions): array {
$newInterval = false; // version checked so we can move to the next one
} else { // time to move on to the next interval
$interval++;
/** @psalm-suppress InvalidArrayOffset We know that $interval is <= 6 thanks to the -1 intervalEndsAfter in the last step */
$step = self::MAX_VERSIONS_PER_INTERVAL[$interval]['step'];
$nextVersion = $prevTimestamp - $step;
if (self::MAX_VERSIONS_PER_INTERVAL[$interval]['intervalEndsAfter'] === -1) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Versions/GroupVersionsExpireManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function expireAll(): void {
}

/**
* @param array{id: int, mount_point: string, groups: array<empty, empty>|array<array-key, int>, quota: int, size: int, acl: bool} $folder
* @param array{acl: bool, groups: array<array-key, array<array-key, int|string>>, id: int, mount_point: mixed, quota: int, size: 0} $folder
*/
public function expireFolder(array $folder): void {
$view = new View('/__groupfolders/versions/' . $folder['id']);
Expand Down

0 comments on commit 207e669

Please sign in to comment.