Passed
Push — master ( 35eebd...7b8a1a )
by Roman
16:45
created

Type::byRole()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Game\Features\GamePlay\Crossword;
6
7
use App\Game\Features\GamePlay\Player\Role;
8
9
final class Type
10
{
11
    private const NORMAL = 'normal';
12
    private const FIGURED = 'figured';
13
14
    public static function byRole(Role $role): string
15
    {
16
        return match ((string) $role->getValue()) {
17
            Role::SIMPLE_PLAYER => self::NORMAL,
18
            Role::PREMIUM_PLAYER => self::FIGURED,
19
        };
20
    }
21
}
22