PeriodStatus::getLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Swis\Melvin\Enums;
6
7
use MyCLabs\Enum\Enum;
8
9
/**
10
 * @method static PeriodStatus INITIAL()
11
 * @method static PeriodStatus PROBABLY_STARTED()
12
 * @method static PeriodStatus STARTED()
13
 * @method static PeriodStatus OVERRUNNING()
14
 * @method static PeriodStatus PROBABLY_ENDED()
15
 * @method static PeriodStatus ENDED()
16
 */
17
final class PeriodStatus extends Enum
18
{
19
    private const INITIAL = 'INITIAL';
20
    private const PROBABLY_STARTED = 'PROBABLY_STARTED';
21
    private const STARTED = 'STARTED';
22
    private const OVERRUNNING = 'OVERRUNNING';
23
    private const PROBABLY_ENDED = 'PROBABLY_ENDED';
24
    private const ENDED = 'ENDED';
25
26
    public function getLabel(): string
27
    {
28
        return [
29
            'INITIAL' => 'Initieel',
30
            'PROBABLY_STARTED' => 'Gestart',
31
            'STARTED' => 'Gestart',
32
            'OVERRUNNING' => 'Uitloop',
33
            'PROBABLY_ENDED' => 'Gestopt',
34
            'ENDED' => 'Gestopt',
35
        ][$this->getKey()];
36
    }
37
}
38