TransportMode   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
c 1
b 0
f 0
dl 0
loc 15
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 8 1
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