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

BuildMenuEnum::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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Building;
6
7
enum BuildMenuEnum: int
8
{
9
    case BUILDMENU_SOCIAL = 1;
10
    case BUILDMENU_INDUSTRY = 2;
11
    case BUILDMENU_INFRASTRUCTURE = 3;
12
    case BUILDMENU_ENERGY = 4;
13
14 1
    public function getDescription(): string
15
    {
16 1
        return match ($this) {
17 1
            self::BUILDMENU_SOCIAL => _('Soziales'),
18 1
            self::BUILDMENU_INDUSTRY => _('Industrie'),
19 1
            self::BUILDMENU_INFRASTRUCTURE => _('Infrastruktur'),
20 1
            self::BUILDMENU_ENERGY => _('Energie'),
21 1
        };
22
    }
23
}
24