From 9bba4df657f7487a7c773a75b00ecb0312aab73d Mon Sep 17 00:00:00 2001 From: binsky Date: Wed, 14 Jun 2023 12:54:49 +0200 Subject: [PATCH] fix deprecations in ExpireCredentials background job --- lib/BackgroundJob/ExpireCredentials.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/BackgroundJob/ExpireCredentials.php b/lib/BackgroundJob/ExpireCredentials.php index a911775e..d8201a86 100644 --- a/lib/BackgroundJob/ExpireCredentials.php +++ b/lib/BackgroundJob/ExpireCredentials.php @@ -23,8 +23,9 @@ namespace OCA\Passman\BackgroundJob; -use OC\BackgroundJob\TimedJob; use OCA\Passman\Service\CronService; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; use OCP\IConfig; /** @@ -34,22 +35,21 @@ use OCP\IConfig; */ class ExpireCredentials extends TimedJob { - protected IConfig $config; - private CronService $cronService; + /** + * ExpireCredentials constructor. + * + * @param ITimeFactory $timeFactory + * @param IConfig $config + * @param CronService $cronService + */ + public function __construct(ITimeFactory $timeFactory, protected IConfig $config, private CronService $cronService) { + parent::__construct($timeFactory); - /** - * ExpireCredentials constructor. - * @param IConfig $config - * @param CronService $cronService - */ - public function __construct(IConfig $config, CronService $cronService) { // Run once per minute $this->setInterval(60); - $this->config = $config; - $this->cronService = $cronService; } - protected function run($argument) { + protected function run($argument): void { $this->cronService->expireCredentials(); } }