VehicleType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 10 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 VehicleType CAR()
11
 * @method static VehicleType VAN()
12
 * @method static VehicleType PEDESTRIAN()
13
 * @method static VehicleType BIKE()
14
 * @method static VehicleType SCOOTER()
15
 * @method static VehicleType AGRICULTURAL_VEHICLE()
16
 */
17
final class VehicleType extends Enum
18
{
19
    private const CAR = 'CAR';
20
    private const VAN = 'VAN';
21
    private const PEDESTRIAN = 'PEDESTRIAN';
22
    private const BIKE = 'BIKE';
23
    private const SCOOTER = 'SCOOTER';
24
    private const AGRICULTURAL_VEHICLE = 'AGRICULTURAL_VEHICLE';
25
26
    public function getLabel(): string
27
    {
28
        return [
29
            'CAR' => 'Auto / Motor',
30
            'VAN' => 'Vrachtwagen',
31
            'PEDESTRIAN' => 'Voetganger',
32
            'BIKE' => '(snor)Fiets',
33
            'SCOOTER' => 'Brommer',
34
            'AGRICULTURAL_VEHICLE' => 'Agrarisch voertuig',
35
        ][$this->getKey()];
36
    }
37
}
38