PlayerHistory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
ccs 4
cts 7
cp 0.5714
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Game\Features\History;
6
7
final class PlayerHistory
8
{
9
    private HistoryDaoInterface $historyDao;
10
11
    public function __construct(HistoryDaoInterface $historyDao)
12
    {
13
        $this->historyDao = $historyDao;
14
    }
15
16 1
    public function __invoke(): array
17
    {
18 1
        return array_map(
19 1
            static fn (HistoryRatingDto $dto): array => $dto->jsonSerialize(),
20 1
            $this->historyDao->ratingHistory()
21
        );
22
    }
23
}
24