PlayerAssembler::toPlayerDto()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Game\Infrastructure\Repository\Doctrine;
6
7
use App\Game\Features\Authorization\PlayerDto;
8
use App\Game\Features\Player\Player\Player;
9
10
final class PlayerAssembler
11
{
12 1
    public function toPlayerDto(Player $player): PlayerDto
13
    {
14 1
        return new PlayerDto(
15 1
            $player->playerId()->id(),
16 1
            $player->nickname(),
17 1
            $player->level(),
18 1
            $player->role()->getValue()
19
        );
20
    }
21
}
22