Passed
Push — master ( 6b97f6...a6ae80 )
by Blizzz
13:11 queued 11s
created

CleanupDirectEditingTokens   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A run() 0 2 1
1
<?php
2
3
namespace OCA\Files\BackgroundJob;
4
5
use OC\BackgroundJob\TimedJob;
6
use OCP\DirectEditing\IManager;
7
8
class CleanupDirectEditingTokens extends TimedJob {
9
10
	private const INTERVAL_MINUTES = 15 * 60;
11
12
	/**
13
	 * @var IManager
14
	 */
15
	private $manager;
16
17
	public function __construct(IManager $manager) {
18
		$this->interval = self::INTERVAL_MINUTES;
19
		$this->manager = $manager;
20
	}
21
22
	/**
23
	 * Makes the background job do its work
24
	 *
25
	 * @param array $argument unused argument
26
	 * @throws \Exception
27
	 */
28
	public function run($argument) {
29
		$this->manager->cleanup();
30
	}
31
}
32