diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-12-01 10:48:14 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-12-01 10:48:14 +0100 |
commit | 478953d0026cd29ddfb466c6eecdb1e60f48534e (patch) | |
tree | 063a020881058fd9fbc3142dc936e7bf9c678c79 /apps/dav/lib | |
parent | dcec9fef736a2424dd08b5bf6feb416203eb4264 (diff) | |
download | nextcloud-server-478953d0026cd29ddfb466c6eecdb1e60f48534e.tar.gz nextcloud-server-478953d0026cd29ddfb466c6eecdb1e60f48534e.zip |
Cast orphan subscription id to int
DB columns are of type int by default, so they need to be casted.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php index 50becf81e78..38d395b2c81 100644 --- a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php +++ b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php @@ -41,7 +41,8 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep { /** @var int */ private $progress = 0; - private $orphanSubscriptions = []; + /** @var int[] */ + private $orphanSubscriptionIds = []; private const SUBSCRIPTIONS_CHUNK_SIZE = 1000; @@ -74,7 +75,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep { $output->finishProgress(); $this->deleteOrphanSubscriptions(); - $output->info(sprintf('%d calendar subscriptions without an user have been cleaned up', count($this->orphanSubscriptions))); + $output->info(sprintf('%d calendar subscriptions without an user have been cleaned up', count($this->orphanSubscriptionIds))); } /** @@ -112,7 +113,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep { while ($row = $result->fetch()) { $username = $this->getPrincipal($row['principaluri']); if (!$this->userManager->userExists($username)) { - $this->orphanSubscriptions[] = $row['id']; + $this->orphanSubscriptionIds[] = (int) $row['id']; } } $result->closeCursor(); @@ -122,7 +123,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep { * @throws Exception */ private function deleteOrphanSubscriptions(): void { - foreach ($this->orphanSubscriptions as $orphanSubscriptionID) { + foreach ($this->orphanSubscriptionIds as $orphanSubscriptionID) { $this->deleteOrphanSubscription($orphanSubscriptionID); } } |