Skip to content

Commit

Permalink
Fix TypeError on versions expire
Browse files Browse the repository at this point in the history
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
  • Loading branch information
solracsf committed Jun 2, 2024
1 parent 226eda0 commit 82e5a7c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Versions/VersionsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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 {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 82e5a7c

Please sign in to comment.