Completed
Push — phpunit ( 7f2080...75f541 )
by Marcos
14:28 queued 10:45
created

ExpireCredentials::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Joas Schilling <[email protected]>
6
 *
7
 * @license AGPL-3.0
8
 *
9
 * This code is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License, version 3,
11
 * as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License, version 3,
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 *
21
 */
22
23
namespace OCA\Passman\BackgroundJob;
24
25
use OC\BackgroundJob\TimedJob;
26
use \OCA\Passman\AppInfo\Application;
27
use OCP\IConfig;
28
29
/**
30
 * Class ExpireCredentials
31
 *
32
 * @package OCA\Passman\BackgroundJob
33
 */
34
class ExpireCredentials extends TimedJob {
35
	/** @var IConfig */
36
	protected $config;
37
38
	/**
39
	 * @param IConfig $config
40
	 */
41
	public function __construct(IConfig $config) {
42
		// Run once per minute
43
		$this->setInterval(60);
44
		$this->config = $config;
45
	}
46
47
	protected function run($argument) {
48
		$app = new Application();
49
		$container = $app->getContainer();
50
		$container->query('CronService')->expireCredentials();
51
	}
52
}
53