TransportMode::getLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Swis\Melvin\Enums;
6
7
use MyCLabs\Enum\Enum;
8
9
/**
10
 * @method static TransportMode CAR()
11
 * @method static TransportMode BIKE()
12
 * @method static TransportMode WALK()
13
 * @method static TransportMode BOAT()
14
 */
15
final class TransportMode extends Enum
16
{
17
    private const CAR = 'CAR';
18
    private const BIKE = 'BIKE';
19
    private const WALK = 'WALK';
20
    private const BOAT = 'BOAT';
21
22
    public function getLabel(): string
23
    {
24
        return [
25
            'CAR' => 'Auto / Motor',
26
            'BIKE' => '(snor)Fiets',
27
            'WALK' => 'Voetganger',
28
            'BOAT' => 'Vaartuig',
29
        ][$this->getKey()];
30
    }
31
}
32