Passed
Push — master ( 5a11dc...578008 )
by Janko
08:39
created

GameStateEnum   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Game;
6
7
enum GameStateEnum: int
8
{
9
    case ONLINE = 1;
10
    case TICK = 2;
11
    case MAINTENANCE = 3;
12
    case RELOCATION = 4;
13
    case RESET = 5;
14
15
    /**
16
     * Returns the textual representation for a game state
17
     */
18 212
    public function getDescription(): string
19
    {
20 212
        return match ($this) {
21 212
            self::ONLINE => 'Online',
22 2
            self::TICK => 'Tick',
23 2
            self::MAINTENANCE => 'Wartung',
24 2
            self::RESET => 'Reset',
25 212
            self::RELOCATION => 'Umzug'
26 212
        };
27
    }
28
}
29