Passed
Push — dev ( 117aec...fd7324 )
by Janko
15:18
created

SpacecraftLssModeEnum::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Spacecraft;
6
7
enum SpacecraftLssModeEnum: int
8
{
9
    case NORMAL = 1;
10
    case BORDER = 2;
11
    case IMPASSABLE = 3;
12
    case CARTOGRAPHING = 4;
13
14 1
    public function getDescription(): string
15
    {
16 1
        return match ($this) {
17 1
            self::NORMAL => "LSS Filter deaktivieren",
18 1
            self::BORDER => "Territorialansicht",
19 1
            self::IMPASSABLE => "Unpassierbarkeitsansicht",
20 1
            self::CARTOGRAPHING => "Kartographieansicht"
21 1
        };
22
    }
23
24 9
    public function isBorderMode(): bool
25
    {
26 9
        return match ($this) {
27 9
            self::NORMAL => false,
28 9
            default => true
29 9
        };
30
    }
31
}
32