Passed
Push — master ( 8ff4e3...ffee1f )
by Samuel
03:00
created

ClientStatus   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDisplayName() 0 7 1
1
<?php
2
3
namespace App\Domain\Client\Enum;
4
5
enum ClientStatus: string
6
{
7
    case ACTION_PENDING = 'Action pending';
8
    case IN_CARE = 'In care';
9
    case HELPED = 'Helped';
10
    case CANNOT_HELP = 'Cannot help';
11
12
    /**
13
     * Get the enum case name that can be displayed by the frontend.
14
     *
15
     * @return string
16
     */
17 14
    public function getDisplayName(): string
18
    {
19 14
        return match ($this) {
20 14
            self::ACTION_PENDING => __('Action pending'),
21 14
            self::IN_CARE => __('In care'),
22 14
            self::HELPED => __('Helped'),
23 14
            self::CANNOT_HELP => __('Cannot help'),
24 14
        };
25
    }
26
}
27