1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2016 Lukas Reschke <[email protected]> |
4
|
|
|
* |
5
|
|
|
* @author Lukas Reschke <[email protected]> |
6
|
|
|
* |
7
|
|
|
* @license GNU AGPL version 3 or any later version |
8
|
|
|
* |
9
|
|
|
* This program is free software: you can redistribute it and/or modify |
10
|
|
|
* it under the terms of the GNU Affero General Public License as |
11
|
|
|
* published by the Free Software Foundation, either version 3 of the |
12
|
|
|
* License, or (at your option) any later version. |
13
|
|
|
* |
14
|
|
|
* This program is distributed in the hope that it will be useful, |
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
* GNU Affero General Public License for more details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU Affero General Public License |
20
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
21
|
|
|
* |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
namespace OCA\Richdocuments\Settings; |
25
|
|
|
|
26
|
|
|
use OCA\Richdocuments\Capabilities; |
27
|
|
|
use OCP\IL10N; |
28
|
|
|
use OCP\IURLGenerator; |
29
|
|
|
use OCP\Settings\IIconSection; |
30
|
|
|
|
31
|
|
|
class Section implements IIconSection { |
32
|
|
|
/** @var IL10N */ |
33
|
|
|
private $l10n; |
34
|
|
|
/** @var IURLGenerator */ |
35
|
|
|
private $url; |
36
|
|
|
/** @var Capabilities */ |
37
|
|
|
private $capabilitites; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param IL10N $l |
|
|
|
|
41
|
|
|
* @param IURLGenerator $url |
42
|
|
|
*/ |
43
|
|
|
public function __construct(IL10N $l10n, IURLGenerator $url, Capabilities $capabilities) { |
44
|
|
|
$this->l10n = $l10n; |
45
|
|
|
$this->url = $url; |
46
|
|
|
$this->capabilitites = $capabilities; |
47
|
|
|
} |
48
|
|
|
/** |
49
|
|
|
* {@inheritdoc} |
50
|
|
|
*/ |
51
|
|
|
public function getID() { |
52
|
|
|
return 'richdocuments'; |
53
|
|
|
} |
54
|
|
|
/** |
55
|
|
|
* {@inheritdoc} |
56
|
|
|
*/ |
57
|
|
|
public function getName() { |
58
|
|
|
$capabilitites = $this->capabilitites->getCapabilities(); |
59
|
|
|
if (isset($capabilitites['richdocuments']['productName'])) { |
60
|
|
|
return $capabilitites['richdocuments']['productName']; |
61
|
|
|
} |
62
|
|
|
return $this->l10n->t('Collabora Online'); |
63
|
|
|
} |
64
|
|
|
/** |
65
|
|
|
* {@inheritdoc} |
66
|
|
|
*/ |
67
|
|
|
public function getPriority() { |
68
|
|
|
return 75; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* {@inheritdoc} |
73
|
|
|
*/ |
74
|
|
|
public function getIcon() { |
75
|
|
|
return $this->url->imagePath('richdocuments', 'app-dark.svg'); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.