Completed
Pull Request — master (#32545)
by Tom
09:55
created

CleanupTransferRequests::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author Tom Needham <[email protected]>
4
 *
5
 * @copyright Copyright (c) 2018, ownCloud GmbH
6
 * @license AGPL-3.0
7
 *
8
 * This code is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License, version 3,
10
 * as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License, version 3,
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19
 *
20
 */
21
22
namespace OCA\Files\BackgroundJob;
23
24
use OC\BackgroundJob\TimedJob;
25
use OC\Lock\Persistent\LockMapper;
26
use OCA\Files\Service\TransferOwnership\TransferRequestMapper;
27
28
/**
29
 * Clean up transfer requests that are long since unaccepted
30
 */
31
class CleanupTransferRequests extends TimedJob {
32
33
	/**
34
	 * Default interval in minutes
35
	 *
36
	 * @var int $defaultIntervalMin
37
	 **/
38
	protected $defaultIntervalMin = 60;
39
	/** @var TransferRequestMapper */
40
	private $mapper;
41
42
	/**
43
	 * CleanupTransferRequests constructor.
44
	 *
45
	 * @param LockMapper $lockMapper
0 ignored issues
show
Documentation introduced by
There is no parameter named $lockMapper. Did you maybe mean $mapper?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
46
	 */
47
	public function __construct(TransferRequestMapper $mapper) {
48
		$this->interval = $this->defaultIntervalMin * 60;
49
		$this->mapper = $mapper;
50
	}
51
52
	/**
53
	 * @param $argument
54
	 */
55
	public function run($argument) {
56
		$this->mapper->cleanup();
57
	}
58
}
59