Fix more typing in OC\Archive classes

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-02-24 12:25:04 +01:00
parent 7b1a044131
commit c9100e3d44
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
3 changed files with 9 additions and 9 deletions

View file

@ -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);
/**

View file

@ -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;
}
/**

View file

@ -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);