Failed Conditions
Push — master ( 0ef5da...6c8847 )
by Adrien
11:04 queued 07:56
created

TestEnum   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Service;
6
7
use Ecodev\Felix\Api\Enum\LocalizedPhpEnumType;
8
9
enum TestEnum: string implements LocalizedPhpEnumType
10
{
11
    case key1 = 'value1';
12
    case key2 = 'value2';
13
14
    public function getDescription(): string
15
    {
16
        return match ($this) {
17
            TestEnum::key1 => 'custom description for key 1',
18
            TestEnum::key2 => 'other for key 2',
19
        };
20
    }
21
}
22