aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/BackgroundJob/CredentialsCleanup.php')
-rw-r--r--apps/files_external/lib/BackgroundJob/CredentialsCleanup.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
index 1ae80735972..90a5ae17ab2 100644
--- a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
+++ b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
@@ -12,36 +12,27 @@ use OCA\Files_External\Lib\Auth\Password\LoginCredentials;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Security\ICredentialsManager;
class CredentialsCleanup extends TimedJob {
- private $credentialsManager;
- private $userGlobalStoragesService;
- private $userManager;
-
public function __construct(
ITimeFactory $time,
- ICredentialsManager $credentialsManager,
- UserGlobalStoragesService $userGlobalStoragesService,
- IUserManager $userManager
+ private ICredentialsManager $credentialsManager,
+ private UserGlobalStoragesService $userGlobalStoragesService,
+ private IUserManager $userManager,
) {
parent::__construct($time);
- $this->credentialsManager = $credentialsManager;
- $this->userGlobalStoragesService = $userGlobalStoragesService;
- $this->userManager = $userManager;
-
// run every day
$this->setInterval(24 * 60 * 60);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
protected function run($argument) {
- $this->userManager->callForSeenUsers(function (IUser $user) {
+ $this->userManager->callForSeenUsers(function (IUser $user): void {
$storages = $this->userGlobalStoragesService->getAllStoragesForUser($user);
$usesLoginCredentials = array_reduce($storages, function (bool $uses, StorageConfig $storage) {