Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-12-01 12:48:14 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-01-31 12:24:19 +0300
commit9bd23752d1f2aeee9b6e9ee1a8141c51917eb8e4 (patch)
treef04a1c55cdfd45aa53b66c7913118ac2d2f65ba8
parent15795c810482715f923a488f792a4bfbe9b06925 (diff)
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>
-rw-r--r--apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php9
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);
}
}