/** @var int */
private $progress = 0;
- private $orphanSubscriptions = [];
+ /** @var int[] */
+ private $orphanSubscriptionIds = [];
private const SUBSCRIPTIONS_CHUNK_SIZE = 1000;
$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)));
}
/**
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();
* @throws Exception
*/
private function deleteOrphanSubscriptions(): void {
- foreach ($this->orphanSubscriptions as $orphanSubscriptionID) {
+ foreach ($this->orphanSubscriptionIds as $orphanSubscriptionID) {
$this->deleteOrphanSubscription($orphanSubscriptionID);
}
}