From 82e5a7c00f029599c022ddef58a2a3a96dadda0c Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Wed, 29 May 2024 18:24:55 +0200 Subject: [PATCH] Fix TypeError on versions expire Fix Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Testing CI Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Fix Lint Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Return FileInfo Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Fix static Fix lint --- lib/Versions/VersionsBackend.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Versions/VersionsBackend.php b/lib/Versions/VersionsBackend.php index c8ad33f94..c0d63b4bd 100644 --- a/lib/Versions/VersionsBackend.php +++ b/lib/Versions/VersionsBackend.php @@ -65,7 +65,7 @@ public function useBackendForStorage(IStorage $storage): bool { return true; } - private function getFolderIdForFile(File $file): int { + private function getFolderIdForFile(FileInfo $file): int { $mount = $file->getMountPoint(); if (!($mount instanceof GroupMountPoint)) { @@ -75,7 +75,7 @@ private function getFolderIdForFile(File $file): int { return $mount->getFolderId(); } - public function getVersionFolderForFile(File $file): Folder { + public function getVersionFolderForFile(FileInfo $file): Folder { $folderId = $this->getFolderIdForFile($file); try { @@ -190,7 +190,7 @@ function (GroupVersionEntity $versionEntity) use ($versionsFolder, $mountPoint, /** * @return void */ - public function createVersion(IUser $user, FileInfo $file) { + public function createVersion(IUser $user, FileInfo $file): void { $versionsFolder = $this->getVersionFolderForFile($file); $versionMount = $versionsFolder->getMountPoint(); @@ -229,6 +229,10 @@ public function rollback(IVersion $version): void { $versionMount->getStorage()->getCache()->copyFromCache($targetCache, $versionCache->get($versionInternalPath), $targetMount->getSourcePath() . '/' . $targetInternalPath); } + /** + * @param IVersion $version + * @return resource|false + */ public function read(IVersion $version) { if ($version instanceof GroupVersion) { return $version->getVersionFile()->fopen('r');