Skip to content

Commit 4e51f52

Browse files
committed
feat(UserMigration)!: 32-bit support
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent c40d1b7 commit 4e51f52

5 files changed

Lines changed: 10 additions & 9 deletions

File tree

apps/dav/lib/UserMigration/CalendarMigrator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ private function getUniqueCalendarUri(IUser $user, string $initialCalendarUri):
211211
/**
212212
* {@inheritDoc}
213213
*/
214-
public function getEstimatedExportSize(IUser $user): int {
214+
public function getEstimatedExportSize(IUser $user): int|float {
215215
$calendarExports = $this->getCalendarExports($user, new NullOutput());
216216
$calendarCount = count($calendarExports);
217217

@@ -230,7 +230,7 @@ function (array $data): int {
230230
// 450B for each component (events, todos, alarms, etc.)
231231
$size += ($componentCount * 450) / 1024;
232232

233-
return (int)ceil($size);
233+
return ceil($size);
234234
}
235235

236236
/**

apps/dav/lib/UserMigration/ContactsMigrator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private function serializeCards(array $vCards): string {
202202
/**
203203
* {@inheritDoc}
204204
*/
205-
public function getEstimatedExportSize(IUser $user): int {
205+
public function getEstimatedExportSize(IUser $user): int|float {
206206
$addressBookExports = $this->getAddressBookExports($user, new NullOutput());
207207
$addressBookCount = count($addressBookExports);
208208

@@ -217,7 +217,7 @@ public function getEstimatedExportSize(IUser $user): int {
217217
// 350B for each contact
218218
$size += ($contactsCount * 350) / 1024;
219219

220-
return (int)ceil($size);
220+
return ceil($size);
221221
}
222222

223223
/**

apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ public function __construct(
6767
/**
6868
* {@inheritDoc}
6969
*/
70-
public function getEstimatedExportSize(IUser $user): int {
70+
public function getEstimatedExportSize(IUser $user): int|float {
7171
$uid = $user->getUID();
7272

7373
try {
7474
$trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin');
7575
if (!$trashbinFolder instanceof Folder) {
7676
return 0;
7777
}
78-
return (int)ceil($trashbinFolder->getSize() / 1024);
78+
return ceil($trashbinFolder->getSize() / 1024);
7979
} catch (\Throwable $e) {
8080
return 0;
8181
}

apps/settings/lib/UserMigration/AccountMigrator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function __construct(
8484
/**
8585
* {@inheritDoc}
8686
*/
87-
public function getEstimatedExportSize(IUser $user): int {
87+
public function getEstimatedExportSize(IUser $user): int|float {
8888
$size = 100; // 100KiB for account JSON
8989

9090
try {
@@ -97,7 +97,7 @@ public function getEstimatedExportSize(IUser $user): int {
9797
// Skip avatar in size estimate on failure
9898
}
9999

100-
return (int)ceil($size);
100+
return ceil($size);
101101
}
102102

103103
/**

lib/public/UserMigration/ISizeEstimationMigrator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ interface ISizeEstimationMigrator {
3838
* Should be fast, favor performance over accuracy.
3939
*
4040
* @since 25.0.0
41+
* @since 27.0.0 return value may overflow from int to float
4142
*/
42-
public function getEstimatedExportSize(IUser $user): int;
43+
public function getEstimatedExportSize(IUser $user): int|float;
4344
}

0 commit comments

Comments
 (0)