Completed
Pull Request — master (#52)
by Morris
02:00
created

Section   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 2
cbo 0
dl 0
loc 49
ccs 0
cts 16
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getID() 0 3 1
A getName() 0 3 1
A getPriority() 0 3 1
A getIcon() 0 3 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016 Joas Schilling <[email protected]>
4
 *
5
 * @license GNU AGPL version 3 or any later version
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Affero General Public License as
9
 * published by the Free Software Foundation, either version 3 of the
10
 * License, or (at your option) any later version.
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
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 */
21
22
namespace OCA\FilesAccessControl\Settings;
23
24
use OCP\IL10N;
25
use OCP\IURLGenerator;
26
use OCP\Settings\IIconSection;
27
28
class Section implements IIconSection {
29
	/** @var IL10N */
30
	private $l;
31
	/** @var IURLGenerator */
32
	private $url;
33
34
	public function __construct(IL10N $l, IURLGenerator $url) {
35
		$this->l = $l;
36
		$this->url = $url;
37
	}
38
39
	/**
40
	 * returns the ID of the section. It is supposed to be a lower case string,
41
	 * e.g. 'ldap'
42
	 *
43
	 * @returns string
44
	 */
45
	public function getID() {
46
		return 'files_accesscontrol';
47
	}
48
49
	/**
50
	 * returns the translated name as it should be displayed, e.g. 'LDAP / AD
51
	 * integration'. Use the L10N service to translate it.
52
	 *
53
	 * @return string
54
	 */
55
	public function getName() {
56
		return $this->l->t('File access control');
57
	}
58
59
	/**
60
	 * @return int whether the form should be rather on the top or bottom of
61
	 * the settings navigation. The sections are arranged in ascending order of
62
	 * the priority values. It is required to return a value between 0 and 99.
63
	 *
64
	 * E.g.: 70
65
	 */
66
	public function getPriority() {
67
		return 70;
68
	}
69
70
	/**
71
	 * {@inheritdoc}
72
	 */
73
	public function getIcon() {
74
		return $this->url->imagePath('files_accesscontrol', 'app-dark.svg');
75
	}
76
}
77