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

SpacecraftLssModeEnum::isBorderMode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
ccs 5
cts 6
cp 0.8333
crap 1.0046
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 4
            self::BORDER => true,
29
            self::IMPASSABLE => true,
30 9
            self::CARTOGRAPHING => true
31 9
        };
32
    }
33
}