ClientStatus   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 19
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 1

1 Method

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