From c9100e3d442a136b2e4888a5a1fcf62fdc04189b Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Thu, 24 Feb 2022 12:25:04 +0100 Subject: [PATCH] Fix more typing in OC\Archive classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Archive/Archive.php | 4 ++-- lib/private/Archive/TAR.php | 8 ++++---- lib/private/Archive/ZIP.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) 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); -- 2.39.5