Failed Conditions
Push — master ( 2be5da...8667b1 )
by Adrien
04:39
created

Relationship::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Enum;
6
7
use Ecodev\Felix\Api\Enum\LocalizedPhpEnumType;
8
9
enum Relationship: string implements LocalizedPhpEnumType
10
{
11
    case Householder = 'householder';
12
    case Partner = 'partner';
13
    case Child = 'child';
14
    case Parent = 'parent';
15
    case Sister = 'sister';
16
    case Brother = 'brother';
17
18 1
    public function getDescription(): string
19
    {
20 1
        return match ($this) {
21 1
            self::Householder => 'Chef(e) de famille',
22 1
            self::Partner => 'Conjoint',
23 1
            self::Child => 'Enfant',
24 1
            self::Parent => 'Parent',
25 1
            self::Sister => 'Soeur',
26 1
            self::Brother => 'Frère',
27 1
        };
28
    }
29
}
30