Completed
Push — master ( 0d9acd...172550 )
by Sander
9s
created

PersonalSection::getPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 3
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Nextcloud - namespace OCA\Nextnote
4
 *
5
 * @copyright Copyright (c) 2016, Sander Brand ([email protected])
6
 * @copyright Copyright (c) 2016, Marcos Zuriaga Miguel ([email protected])
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\NextNote\Settings;
25
26
27
use OCP\IL10N;
28
use OCP\IURLGenerator;
29
use OCP\Settings\IIconSection;
30
31 View Code Duplication
class PersonalSection implements IIconSection {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
	/** @var IURLGenerator */
33
	private $urlGenerator;
34
	/** @var IL10N */
35
	private $l;
36
	public function __construct(IURLGenerator $urlGenerator, IL10N $l) {
37
		$this->urlGenerator = $urlGenerator;
38
		$this->l = $l;
39
	}
40
	/**
41
	 * returns the relative path to an 16*16 icon describing the section.
42
	 * e.g. '/core/img/places/files.svg'
43
	 *
44
	 * @returns string
45
	 * @since 13.0.0
46
	 */
47
	public function getIcon() {
48
		return $this->urlGenerator->imagePath('nextnote', 'app-icon.svg');
49
	}
50
	/**
51
	 * returns the ID of the section. It is supposed to be a lower case string,
52
	 * e.g. 'ldap'
53
	 *
54
	 * @returns string
55
	 * @since 9.1
56
	 */
57
	public function getID() {
58
		return 'nextnote';
59
	}
60
	/**
61
	 * returns the translated name as it should be displayed, e.g. 'LDAP / AD
62
	 * integration'. Use the L10N service to translate it.
63
	 *
64
	 * @return string
65
	 * @since 9.1
66
	 */
67
	public function getName() {
68
		return $this->l->t('NextNote');
69
	}
70
	/**
71
	 * @return int whether the form should be rather on the top or bottom of
72
	 * the settings navigation. The sections are arranged in ascending order of
73
	 * the priority values. It is required to return a value between 0 and 99.
74
	 *
75
	 * E.g.: 70
76
	 * @since 9.1
77
	 */
78
	public function getPriority() {
79
		return 0;
80
	}
81
}