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:
parent
33b52077ff
commit
1765908c03
4 changed files with 13 additions and 9 deletions
apps/files_versions/lib
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue