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 |
|
|
|
|
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
|
|
|
|
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 methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.