From 9677cb86cb37e474a5072cad21341ab6ea45794e Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 2 Apr 2025 12:44:54 +0200 Subject: [PATCH] chore: Use iterator in ExpireTrash command Signed-off-by: Louis Chemineau --- apps/files_trashbin/lib/Command/ExpireTrash.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 37b35689666..2dd02807cfd 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -64,10 +64,12 @@ class ExpireTrash extends Command { } else { $p = new ProgressBar($output); $p->start(); - $this->userManager->callForSeenUsers(function (IUser $user) use ($p): void { + + $users = $this->userManager->getSeenUsers(); + foreach ($users as $user) { $p->advance(); $this->expireTrashForUser($user); - }); + } $p->finish(); $output->writeln(''); }