AdminSection::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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-2021 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 AdminSection 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
}