PersonalSection::getIcon()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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 PersonalSection 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
     * @return string
28
     */
29
    public function getIcon()
30
    {
31
        return $this->urlGenerator->imagePath('facerecognition', 'app-dark.svg');
32
    }
33
34
    /**
35
     * returns the ID of the section. It is supposed to be a lower case string,
36
     *
37
     * @returns string
38
     *
39
     * @return string
40
     *
41
     * @psalm-return 'facerecognition'
42
     */
43
    public function getID()
44
    {
45
        return 'facerecognition';
46
    }
47
48
    /**
49
     * returns the translated name as it should be displayed
50
     *
51
     * @return string
52
     */
53
    public function getName()
54
    {
55
        return $this->l->t('Face Recognition');
56
    }
57
58
    /**
59
     * returns priority for positioning
60
     *
61
     * @return int
62
     */
63
    public function getPriority()
64
    {
65
        return 10;
66
    }
67
}