diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-11 22:25:07 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-11 22:25:07 +0200 |
commit | cd53498256c8d600821a55180c75564bcc63a364 (patch) | |
tree | 01ad255ce09a51f1e7aafd370b28b4568d627c8a /apps/files_versions/lib/BackgroundJob/ExpireVersions.php | |
parent | 8d17d7f6cd1027a96586a25ae5a583ec50d56797 (diff) | |
download | nextcloud-server-cd53498256c8d600821a55180c75564bcc63a364.tar.gz nextcloud-server-cd53498256c8d600821a55180c75564bcc63a364.zip |
Use more magic DI in files_versions
There is no need to register this. The system can figure out by itself
what it needs to do :)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_versions/lib/BackgroundJob/ExpireVersions.php')
-rw-r--r-- | apps/files_versions/lib/BackgroundJob/ExpireVersions.php | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php index d69e5bb87ce..47a1903a535 100644 --- a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php +++ b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php @@ -44,22 +44,12 @@ class ExpireVersions extends \OC\BackgroundJob\TimedJob { */ private $userManager; - public function __construct(IUserManager $userManager = null, Expiration $expiration = null) { + public function __construct(IUserManager $userManager, Expiration $expiration) { // Run once per 30 minutes $this->setInterval(60 * 30); - if (is_null($expiration) || is_null($userManager)) { - $this->fixDIForJobs(); - } else { - $this->expiration = $expiration; - $this->userManager = $userManager; - } - } - - protected function fixDIForJobs() { - $application = new Application(); - $this->expiration = $application->getContainer()->query('Expiration'); - $this->userManager = \OC::$server->getUserManager(); + $this->expiration = $expiration; + $this->userManager = $userManager; } protected function run($argument) { |