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

FightWolfDecision::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Event\Story\FirstChapter\WolfEncounter;
6
7
use AardsGerds\Game\Entity\Beast\Animal\Wolf;
8
use AardsGerds\Game\Event\Decision;
9
use AardsGerds\Game\Event\Story\FirstChapter\FightWolf\FightWolfEvent;
10
use AardsGerds\Game\Player\Player;
11
use AardsGerds\Game\Event\Event;
12
13
final class FightWolfDecision extends Decision
14
{
15
    public function __construct(
16
        Player $player,
17
        private Wolf $wolf,
18
    ) {
19
        parent::__construct($player);
20
    }
21
22
    public function __invoke(): Event
23
    {
24
        return new FightWolfEvent($this->player, $this->wolf);
25
    }
26
27
    public function __toString(): string
28
    {
29
        return "Attack wolf";
30
    }
31
}
32