From 4e51f5224c0536c932753eeb21264594f99dcd73 Mon Sep 17 00:00:00 2001
From: Christopher Ng <chrng8@gmail.com>
Date: Fri, 5 May 2023 17:59:57 -0700
Subject: feat(UserMigration)!: 32-bit support

Signed-off-by: Christopher Ng <chrng8@gmail.com>
---
 apps/dav/lib/UserMigration/CalendarMigrator.php            | 4 ++--
 apps/dav/lib/UserMigration/ContactsMigrator.php            | 4 ++--
 apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php | 4 ++--
 apps/settings/lib/UserMigration/AccountMigrator.php        | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

(limited to 'apps')

diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php
index 057f7dce77d..e5b404e785f 100644
--- a/apps/dav/lib/UserMigration/CalendarMigrator.php
+++ b/apps/dav/lib/UserMigration/CalendarMigrator.php
@@ -211,7 +211,7 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
 	/**
 	 * {@inheritDoc}
 	 */
-	public function getEstimatedExportSize(IUser $user): int {
+	public function getEstimatedExportSize(IUser $user): int|float {
 		$calendarExports = $this->getCalendarExports($user, new NullOutput());
 		$calendarCount = count($calendarExports);
 
@@ -230,7 +230,7 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
 		// 450B for each component (events, todos, alarms, etc.)
 		$size += ($componentCount * 450) / 1024;
 
-		return (int)ceil($size);
+		return ceil($size);
 	}
 
 	/**
diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php
index 196d0a6110a..58e267ab28c 100644
--- a/apps/dav/lib/UserMigration/ContactsMigrator.php
+++ b/apps/dav/lib/UserMigration/ContactsMigrator.php
@@ -202,7 +202,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
 	/**
 	 * {@inheritDoc}
 	 */
-	public function getEstimatedExportSize(IUser $user): int {
+	public function getEstimatedExportSize(IUser $user): int|float {
 		$addressBookExports = $this->getAddressBookExports($user, new NullOutput());
 		$addressBookCount = count($addressBookExports);
 
@@ -217,7 +217,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
 		// 350B for each contact
 		$size += ($contactsCount * 350) / 1024;
 
-		return (int)ceil($size);
+		return ceil($size);
 	}
 
 	/**
diff --git a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
index 70338a469d3..842721eeac9 100644
--- a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
+++ b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
@@ -67,7 +67,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
 	/**
 	 * {@inheritDoc}
 	 */
-	public function getEstimatedExportSize(IUser $user): int {
+	public function getEstimatedExportSize(IUser $user): int|float {
 		$uid = $user->getUID();
 
 		try {
@@ -75,7 +75,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
 			if (!$trashbinFolder instanceof Folder) {
 				return 0;
 			}
-			return (int)ceil($trashbinFolder->getSize() / 1024);
+			return ceil($trashbinFolder->getSize() / 1024);
 		} catch (\Throwable $e) {
 			return 0;
 		}
diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php
index e8c70624224..a779ad76c8d 100644
--- a/apps/settings/lib/UserMigration/AccountMigrator.php
+++ b/apps/settings/lib/UserMigration/AccountMigrator.php
@@ -84,7 +84,7 @@ class AccountMigrator implements IMigrator, ISizeEstimationMigrator {
 	/**
 	 * {@inheritDoc}
 	 */
-	public function getEstimatedExportSize(IUser $user): int {
+	public function getEstimatedExportSize(IUser $user): int|float {
 		$size = 100; // 100KiB for account JSON
 
 		try {
@@ -97,7 +97,7 @@ class AccountMigrator implements IMigrator, ISizeEstimationMigrator {
 			// Skip avatar in size estimate on failure
 		}
 
-		return (int)ceil($size);
+		return ceil($size);
 	}
 
 	/**
-- 
cgit v1.2.3