0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-13 07:53:51 +00:00

Document that size may be a float in new class VersionEntity

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-01-30 16:15:45 +01:00
parent 33b52077ff
commit 1765908c03
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
4 changed files with 13 additions and 9 deletions
apps/files_versions/lib

View file

@ -36,8 +36,8 @@ use OCP\DB\Types;
* @method void setFileId(int $fileId)
* @method int getTimestamp()
* @method void setTimestamp(int $timestamp)
* @method int getSize()
* @method void setSize(int $size)
* @method int|float getSize()
* @method void setSize(int|float $size)
* @method int getMimetype()
* @method void setMimetype(int $mimetype)
* @method array|null getMetadata()

View file

@ -68,7 +68,11 @@ class VersionFile implements IFile {
return (string)$this->version->getRevisionId();
}
public function getSize(): int {
/**
* @psalm-suppress ImplementedReturnTypeMismatch \Sabre\DAV\IFile::getSize signature does not support 32bit
* @return int|float
*/
public function getSize(): int|float {
return $this->version->getSize();
}

View file

@ -65,10 +65,10 @@ interface IVersion {
/**
* Get the size of this version
*
* @return int
* @return int|float
* @since 15.0.0
*/
public function getSize(): int;
public function getSize(): int|float;
/**
* Get the name of the source file at the time of making this version

View file

@ -40,7 +40,7 @@ class Version implements IVersion, INameableVersion {
private string $label;
/** @var int */
/** @var int|float */
private $size;
/** @var string */
@ -62,7 +62,7 @@ class Version implements IVersion, INameableVersion {
int $timestamp,
$revisionId,
string $name,
int $size,
int|float $size,
string $mimetype,
string $path,
FileInfo $sourceFileInfo,
@ -98,7 +98,7 @@ class Version implements IVersion, INameableVersion {
return $this->timestamp;
}
public function getSize(): int {
public function getSize(): int|float {
return $this->size;
}