Test Failed
Push — master ( 55d9e9...6ae951 )
by Paweł
02:43
created

Player   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 21
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A increaseExperience() 0 2 1
A levelUp() 0 6 1
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Player;
6
7
use AardsGerds\Game\Build\Attribute\AttributePoints;
8
use AardsGerds\Game\Build\Level;
9
use AardsGerds\Game\Build\LevelProgress;
10
use AardsGerds\Game\Build\Talent\TalentPoints;
11
12
final class Player
13
{
14
    public function __construct(
15
        private string $name,
16
        private Level $level,
17
        private LevelProgress $levelProgress,
18
        private AttributePoints $attributePoints,
19
        private TalentPoints $talentPoints,
20
    ) {}
21
22
    public function increaseExperience(): void
23
    {
24
25
    }
26
27
    public function levelUp(): void
28
    {
29
        $this->level->increment();
30
        $this->levelProgress->reset();
31
        $this->attributePoints->increaseBy(new AttributePoints(5));
32
        $this->talentPoints->increaseBy(new TalentPoints(3));
33
    }
34
}
35