From: Côme Chilliet Date: Thu, 24 Feb 2022 11:25:04 +0000 (+0100) Subject: Fix more typing in OC\Archive classes X-Git-Tag: v24.0.0beta1~142^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c9100e3d442a136b2e4888a5a1fcf62fdc04189b;p=nextcloud-server.git Fix more typing in OC\Archive classes Signed-off-by: Côme Chilliet --- diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php index 4f8100530ac..31db51d59a1 100644 --- a/lib/private/Archive/Archive.php +++ b/lib/private/Archive/Archive.php @@ -57,13 +57,13 @@ abstract class Archive { /** * get the uncompressed size of a file in the archive * @param string $path - * @return int + * @return int|false */ abstract public function filesize($path); /** * get the last modified time of a file in the archive * @param string $path - * @return int + * @return int|false */ abstract public function mtime($path); /** diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index 1b8f72fd6ce..a3c2abb41bb 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -186,22 +186,22 @@ class TAR extends Archive { * get the uncompressed size of a file in the archive * * @param string $path - * @return int + * @return int|false */ public function filesize($path) { $stat = $this->getHeader($path); - return $stat['size']; + return $stat['size'] ?? false; } /** * get the last modified time of a file in the archive * * @param string $path - * @return int + * @return int|false */ public function mtime($path) { $stat = $this->getHeader($path); - return $stat['mtime']; + return $stat['mtime'] ?? false; } /** diff --git a/lib/private/Archive/ZIP.php b/lib/private/Archive/ZIP.php index 8c1b162206d..5dad747edf0 100644 --- a/lib/private/Archive/ZIP.php +++ b/lib/private/Archive/ZIP.php @@ -97,16 +97,16 @@ class ZIP extends Archive { /** * get the uncompressed size of a file in the archive * @param string $path - * @return int + * @return int|false */ public function filesize($path) { $stat = $this->zip->statName($path); - return $stat['size']; + return $stat['size'] ?? false; } /** * get the last modified time of a file in the archive * @param string $path - * @return int + * @return int|false */ public function mtime($path) { return filemtime($this->path);