VehicleType::getLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 9
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 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