Passed
Push — memory-limits ( 1af5f0...99d601 )
by Matias
04:34
created

AdminSection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace OCA\FaceRecognition\Settings;
4
5
use OCP\IL10N;
6
use OCP\IURLGenerator;
7
use OCP\Settings\IIconSection;
8
9
class AdminSection implements IIconSection
10
{
11
    /** @var IURLGenerator */
12
    private $urlGenerator;
13
    /** @var IL10N */
14
    private $l;
15
16
    public function __construct(IURLGenerator $urlGenerator, IL10N $l)
17
    {
18
        $this->urlGenerator = $urlGenerator;
19
        $this->l = $l;
20
    }
21
22
    /**
23
     * returns the relative path to an 16*16 icon describing the section.
24
     *
25
     * @returns string
26
     */
27
    public function getIcon()
28
    {
29
        return $this->urlGenerator->imagePath('facerecognition', 'app-dark.svg');
30
    }
31
32
    /**
33
     * returns the ID of the section. It is supposed to be a lower case string,
34
     *
35
     * @returns string
36
     */
37
    public function getID()
38
    {
39
        return 'facerecognition';
40
    }
41
42
    /**
43
     * returns the translated name as it should be displayed
44
     *
45
     * @return string
46
     */
47
    public function getName()
48
    {
49
        return $this->l->t('Face Recognition');
50
    }
51
52
    /**
53
     * returns priority for positioning
54
     *
55
     * @return int
56
     */
57
    public function getPriority()
58
    {
59
        return 10;
60
    }
61
}