diff --git a/apps/files_versions/lib/Controller/PreviewController.php b/apps/files_versions/lib/Controller/PreviewController.php index f41250a897..28d16b8a96 100644 --- a/apps/files_versions/lib/Controller/PreviewController.php +++ b/apps/files_versions/lib/Controller/PreviewController.php @@ -95,7 +95,7 @@ class PreviewController extends Controller { $user = $this->userSession->getUser(); $userFolder = $this->rootFolder->getUserFolder($user->getUID()); $file = $userFolder->get($file); - $versionFile = $this->versionManager->getVersionFile($user, $file, (int)$version); + $versionFile = $this->versionManager->getVersionFile($user, $file, $version); $preview = $this->previewManager->getPreview($versionFile, $x, $y, true, IPreview::MODE_FILL, $versionFile->getMimetype()); return new FileDisplayResponse($preview, Http::STATUS_OK, ['Content-Type' => $preview->getMimeType()]); } catch (NotFoundException $e) { diff --git a/apps/files_versions/lib/Versions/IVersion.php b/apps/files_versions/lib/Versions/IVersion.php index b6fc95814d..d12bdc9d0b 100644 --- a/apps/files_versions/lib/Versions/IVersion.php +++ b/apps/files_versions/lib/Versions/IVersion.php @@ -46,10 +46,10 @@ interface IVersion { /** * Get the id of the revision for the file * - * @return int + * @return int|string * @since 15.0.0 */ - public function getRevisionId(): int; + public function getRevisionId(); /** * Get the timestamp this version was created diff --git a/apps/files_versions/lib/Versions/IVersionBackend.php b/apps/files_versions/lib/Versions/IVersionBackend.php index 913745c985..055d2eab17 100644 --- a/apps/files_versions/lib/Versions/IVersionBackend.php +++ b/apps/files_versions/lib/Versions/IVersionBackend.php @@ -85,9 +85,9 @@ interface IVersionBackend { * * @param IUser $user * @param FileInfo $sourceFile - * @param int $revision + * @param int|string $revision * @return ISimpleFile * @since 15.0.0 */ - public function getVersionFile(IUser $user, FileInfo $sourceFile, int $revision): File; + public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File; } diff --git a/apps/files_versions/lib/Versions/LegacyVersionsBackend.php b/apps/files_versions/lib/Versions/LegacyVersionsBackend.php index aceddef29d..46bd2ea8d4 100644 --- a/apps/files_versions/lib/Versions/LegacyVersionsBackend.php +++ b/apps/files_versions/lib/Versions/LegacyVersionsBackend.php @@ -113,7 +113,7 @@ class LegacyVersionsBackend implements IVersionBackend { return $file->fopen('r'); } - public function getVersionFile(IUser $user, FileInfo $sourceFile, int $revision): File { + public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File { $userFolder = $this->rootFolder->getUserFolder($user->getUID()); $versionFolder = $this->getVersionFolder($user); /** @var File $file */ diff --git a/apps/files_versions/lib/Versions/Version.php b/apps/files_versions/lib/Versions/Version.php index 5988234db6..3a60dc0731 100644 --- a/apps/files_versions/lib/Versions/Version.php +++ b/apps/files_versions/lib/Versions/Version.php @@ -29,7 +29,7 @@ class Version implements IVersion { /** @var int */ private $timestamp; - /** @var int */ + /** @var int|string */ private $revisionId; /** @var string */ @@ -55,7 +55,7 @@ class Version implements IVersion { public function __construct( int $timestamp, - int $revisionId, + $revisionId, string $name, int $size, string $mimetype, @@ -83,7 +83,7 @@ class Version implements IVersion { return $this->sourceFileInfo; } - public function getRevisionId(): int { + public function getRevisionId() { return $this->revisionId; } diff --git a/apps/files_versions/lib/Versions/VersionManager.php b/apps/files_versions/lib/Versions/VersionManager.php index 99fa9f62bc..23cf43ba35 100644 --- a/apps/files_versions/lib/Versions/VersionManager.php +++ b/apps/files_versions/lib/Versions/VersionManager.php @@ -98,7 +98,7 @@ class VersionManager implements IVersionManager { return $backend->read($version); } - public function getVersionFile(IUser $user, FileInfo $sourceFile, int $revision): File { + public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File { $backend = $this->getBackendForStorage($sourceFile->getStorage()); return $backend->getVersionFile($user, $sourceFile, $revision); }