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

UserActivity::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\User\Enum;
4
5
enum UserActivity: string
6
{
7
    case CREATED = 'created';
8
    case UPDATED = 'updated';
9
    case DELETED = 'deleted';
10
    case READ = 'read';
11
12 1
    public function getDisplayName(): string
13
    {
14 1
        return match ($this) {
15 1
            self::CREATED => __('created'),
16 1
            self::UPDATED => __('updated'),
17 1
            self::DELETED => __('deleted'),
18 1
            self::READ => __('read'),
19 1
        };
20
    }
21
}
22