Passed
Pull Request — dev (#2044)
by Nico
11:37
created

SpacecraftLssModeEnum   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 92.31%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 24
ccs 12
cts 13
cp 0.9231
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 7 1
A isBorderMode() 0 7 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 4
            self::BORDER => true,
29
            self::IMPASSABLE => true,
30 9
            self::CARTOGRAPHING => true
31 9
        };
32
    }
33
}