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

SpacecraftLssModeEnum   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 22
rs 10
c 0
b 0
f 0
ccs 11
cts 11
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 7 1
A isBorderMode() 0 5 1
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