Passed
Push — master ( cdfe84...9137c7 )
by Paweł
21:48
created

LootWolfDecision   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 7
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 3 1
A __invoke() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Event\Story\FirstChapter\FightWolf;
6
7
use AardsGerds\Game\Entity\Beast\Animal\Wolf;
8
use AardsGerds\Game\Event\Decision;
9
use AardsGerds\Game\Event\Event;
10
use AardsGerds\Game\Player\Player;
11
12
final class LootWolfDecision extends Decision
13
{
14
    public function __construct(
15
        Player $player,
16
        private Wolf $wolf,
17
    ) {
18
        parent::__construct($player);
19
    }
20
21
    public function __invoke(): Event
22
    {
23
        return new FightWolfEvent($this->player, $this->wolf); // todo: change event
24
    }
25
26
    public function __toString()
27
    {
28
        return 'Loot wolf';
29
    }
30
}
31