Passed
Pull Request — master (#2311)
by Nico
07:31 queued 02:09
created

QuestUserModeEnum::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Quest;
6
7
enum QuestUserModeEnum: int
8
{
9
    case ACTIVE_MEMBER = 1;
10
    case APPLICANT = 2;
11
    case INVITED = 3;
12
    case REJECTED_EXCLUDED = 4;
13
14
    public function getName(): string
15
    {
16
        return match ($this) {
17
            self::ACTIVE_MEMBER => 'Aktive Mitglieder',
18
            self::APPLICANT => 'Bewerber',
19
            self::INVITED => 'Eingeladen',
20
            self::REJECTED_EXCLUDED => 'Abgelehnt/Ausgeschlossen'
21
        };
22
    }
23
24
    public function getCssClass(): string
25
    {
26
        return match ($this) {
27
            self::ACTIVE_MEMBER => 'pos',
28
            self::APPLICANT => 'neg',
29
            self::INVITED => 'positive',
30
            self::REJECTED_EXCLUDED => 'negative'
31
        };
32
    }
33
}