aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Archive
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-01-20 18:02:45 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-02-07 11:23:28 +0100
commitff776a90b133fa113c29511a5a7983a7a1a8b73c (patch)
tree5a0493e0939477a082ae2d1811f94788efcd9a33 /lib/private/Archive
parent2d8e696c24fef754662ed20f17b5b52091491ac5 (diff)
downloadnextcloud-server-ff776a90b133fa113c29511a5a7983a7a1a8b73c.tar.gz
nextcloud-server-ff776a90b133fa113c29511a5a7983a7a1a8b73c.zip
Strong type filesize related methods to ease 32bits problem findings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Archive')
-rw-r--r--lib/private/Archive/Archive.php3
-rw-r--r--lib/private/Archive/TAR.php4
-rw-r--r--lib/private/Archive/ZIP.php3
3 files changed, 3 insertions, 7 deletions
diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php
index cef306230fd..ff6456113f8 100644
--- a/lib/private/Archive/Archive.php
+++ b/lib/private/Archive/Archive.php
@@ -50,9 +50,8 @@ abstract class Archive {
/**
* get the uncompressed size of a file in the archive
- * @return int|false
*/
- abstract public function filesize(string $path);
+ abstract public function filesize(string $path): false|int|float;
/**
* get the last modified time of a file in the archive
diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php
index 79c09cbe9e2..9dc906384e0 100644
--- a/lib/private/Archive/TAR.php
+++ b/lib/private/Archive/TAR.php
@@ -165,10 +165,8 @@ class TAR extends Archive {
/**
* get the uncompressed size of a file in the archive
- *
- * @return int|false
*/
- public function filesize(string $path) {
+ public function filesize(string $path): false|int|float {
$stat = $this->getHeader($path);
return $stat['size'] ?? false;
}
diff --git a/lib/private/Archive/ZIP.php b/lib/private/Archive/ZIP.php
index 743d313f951..f98009ecc3a 100644
--- a/lib/private/Archive/ZIP.php
+++ b/lib/private/Archive/ZIP.php
@@ -91,9 +91,8 @@ class ZIP extends Archive {
/**
* get the uncompressed size of a file in the archive
- * @return int|false
*/
- public function filesize(string $path) {
+ public function filesize(string $path): false|int|float {
$stat = $this->zip->statName($path);
return $stat['size'] ?? false;
}