AdminSection   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 51
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A __construct() 0 4 1
A getIcon() 0 3 1
A getPriority() 0 3 1
A getID() 0 3 1
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 AdminSection implements IIconSection
19
{
20
    /** @var IURLGenerator */
21
    private IURLGenerator $urlGenerator;
22
    /** @var IL10N */
23
    private IL10N $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
}