aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Streamer.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-01-23 15:03:56 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-02-07 11:23:31 +0100
commitcd885b57057b506169faf8ac455f5b1fba811bbf (patch)
treeb7993a9756bed4c697b24d6070d043b3c1cffed1 /lib/private/Streamer.php
parent5c1a0e0307408b9f9031b40beaadaa9f45732c84 (diff)
downloadnextcloud-server-cd885b57057b506169faf8ac455f5b1fba811bbf.tar.gz
nextcloud-server-cd885b57057b506169faf8ac455f5b1fba811bbf.zip
Type sizes as int|float throughout the code base
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Streamer.php')
-rw-r--r--lib/private/Streamer.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/Streamer.php b/lib/private/Streamer.php
index 1375489d360..52f824fedf8 100644
--- a/lib/private/Streamer.php
+++ b/lib/private/Streamer.php
@@ -40,7 +40,7 @@ use ZipStreamer\ZipStreamer;
class Streamer {
// array of regexp. Matching user agents will get tar instead of zip
- private $preferTarFor = [ '/macintosh|mac os x/i' ];
+ private array $preferTarFor = [ '/macintosh|mac os x/i' ];
// streamer instance
private $streamerInstance;
@@ -49,11 +49,11 @@ class Streamer {
* Streamer constructor.
*
* @param IRequest $request
- * @param int $size The size of the files in bytes
+ * @param int|float $size The size of the files in bytes
* @param int $numberOfFiles The number of files (and directories) that will
* be included in the streamed file
*/
- public function __construct(IRequest $request, int $size, int $numberOfFiles) {
+ public function __construct(IRequest $request, int|float $size, int $numberOfFiles) {
/**
* zip32 constraints for a basic (without compression, volumes nor
* encryption) zip file according to the Zip specification:
@@ -149,11 +149,11 @@ class Streamer {
*
* @param resource $stream Stream to read data from
* @param string $internalName Filepath and name to be used in the archive.
- * @param int $size Filesize
- * @param int|bool $time File mtime as int, or false
+ * @param int|float $size Filesize
+ * @param int|false $time File mtime as int, or false
* @return bool $success
*/
- public function addFileFromStream($stream, string $internalName, int $size, $time): bool {
+ public function addFileFromStream($stream, string $internalName, int|float $size, $time): bool {
$options = [];
if ($time) {
$options = [