PersonalSection::getID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Audio Player
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the LICENSE.md file.
7
 *
8
 * @author Marcel Scherello <[email protected]>
9
 * @copyright 2016-2019 Marcel Scherello
10
 */
11
12
namespace OCA\audioplayer\Settings;
13
14
use OCP\IL10N;
15
use OCP\IURLGenerator;
16
use OCP\Settings\IIconSection;
17
18
class PersonalSection implements IIconSection
19
{
20
    /** @var IURLGenerator */
21
    private $urlGenerator;
22
    /** @var IL10N */
23
    private $l;
24
25
    public function __construct(IURLGenerator $urlGenerator, IL10N $l)
26
    {
27
        $this->urlGenerator = $urlGenerator;
28
        $this->l = $l;
29
    }
30
31
    /**
32
     * returns the relative path to an 16*16 icon describing the section.
33
     *
34
     * @returns string
35
     */
36
    public function getIcon()
37
    {
38
        return $this->urlGenerator->imagePath('audioplayer', 'app-dark.svg');
39
    }
40
41
    /**
42
     * returns the ID of the section. It is supposed to be a lower case string,
43
     *
44
     * @returns string
45
     */
46
    public function getID()
47
    {
48
        return 'audioplayer';
49
    }
50
51
    /**
52
     * returns the translated name as it should be displayed
53
     *
54
     * @return string
55
     */
56
    public function getName()
57
    {
58
        return $this->l->t('Audio Player');
59
    }
60
61
    /**
62
     * returns priority for positioning
63
     *
64
     * @return int
65
     */
66
    public function getPriority()
67
    {
68
        return 10;
69
    }
70
}