diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-02-24 12:25:04 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-02-24 12:25:04 +0100 |
commit | c9100e3d442a136b2e4888a5a1fcf62fdc04189b (patch) | |
tree | 89849be950784a5b8da96e5e5813dc6ed024a683 | |
parent | 7b1a0441312124784b9d6efab72c8c496f8f7c69 (diff) | |
download | nextcloud-server-c9100e3d442a136b2e4888a5a1fcf62fdc04189b.tar.gz nextcloud-server-c9100e3d442a136b2e4888a5a1fcf62fdc04189b.zip |
Fix more typing in OC\Archive classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/private/Archive/Archive.php | 4 | ||||
-rw-r--r-- | lib/private/Archive/TAR.php | 8 | ||||
-rw-r--r-- | 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); |