TravelEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A __invoke() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Event;
6
7
use AardsGerds\Game\Event\Decision\Decision;
8
use AardsGerds\Game\Event\Decision\DecisionCollection;
9
use AardsGerds\Game\Player\Player;
10
use AardsGerds\Game\Player\PlayerAction;
11
12
abstract class TravelEvent extends Event
13
{
14
    public function __construct(
15
        Context $context,
16
        DecisionCollection $decisionCollection,
17
    ) {
18
        parent::__construct(
19
            $context,
20
            $decisionCollection,
21
        );
22
    }
23
24
    public function __invoke(Player $player, PlayerAction $playerAction): Decision
25
    {
26
        // travel, encounter or explore?
27
        return $playerAction->askForDecision((string) $this->context, $this->decisionCollection);
28
    }
29
}
30