Test Setup Failed
Push — master ( 647a95...23a558 )
by Jesse
02:13
created

UnitMovedIntoPlay   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A player() 0 3 1
A match() 0 3 1
A __construct() 0 10 1
A card() 0 3 1
A offset() 0 3 1
A aggregateId() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Match\Event;
4
5
use Stratadox\CardGame\Deck\CardId;
6
use Stratadox\CardGame\Match\MatchEvent;
7
use Stratadox\CardGame\Match\MatchId;
8
9
final class UnitMovedIntoPlay implements MatchEvent
10
{
11
    /** @var MatchId */
12
    private $match;
13
    /** @var CardId */
14
    private $card;
15
    /** @var int */
16
    private $player;
17
    /** @var int */
18
    private $offset;
19
20
    public function __construct(
21
        MatchId $match,
22
        CardId $card,
23
        int $player,
24
        int $offset
25
    ) {
26
        $this->match = $match;
27
        $this->card = $card;
28
        $this->player = $player;
29
        $this->offset = $offset;
30
    }
31
32
    public function aggregateId(): MatchId
33
    {
34
        return $this->match;
35
    }
36
37
    public function match(): MatchId
38
    {
39
        return $this->aggregateId();
40
    }
41
42
    public function card(): CardId
43
    {
44
        return $this->card;
45
    }
46
47
    public function player(): int
48
    {
49
        return $this->player;
50
    }
51
52
    public function offset(): int
53
    {
54
        return $this->offset;
55
    }
56
}
57