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

ClientStatus::getDisplayName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

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