ClientStatus::getDisplayName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.037

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
ccs 4
cts 6
cp 0.6667
crap 1.037
rs 10
c 0
b 0
f 0
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