Source::getLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 6
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 Source MELVIN()
11
 * @method static Source SPIN()
12
 * @method static Source LTC()
13
 */
14
final class Source extends Enum
15
{
16
    private const MELVIN = 'MELVIN';
17
    private const SPIN = 'SPIN';
18
    private const LTC = 'LTC';
19
20
    public function getLabel(): string
21
    {
22
        return [
23
            'MELVIN' => 'Melvin',
24
            'SPIN' => 'SPIN',
25
            'LTC' => 'LTC',
26
        ][$this->getKey()];
27
    }
28
}
29