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

CardWasDrawn   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A offset() 0 3 1
A match() 0 3 1
A card() 0 3 1
A player() 0 3 1
A __construct() 0 10 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 CardWasDrawn implements MatchEvent
10
{
11
    private $match;
12
    private $player;
13
    private $card;
14
    private $offset;
15
16
    public function __construct(
17
        MatchId $match,
18
        CardId $card,
19
        int $player,
20
        int $offset
21
    ) {
22
        $this->match = $match;
23
        $this->card = $card;
24
        $this->player = $player;
25
        $this->offset = $offset;
26
    }
27
28
    public function aggregateId(): MatchId
29
    {
30
        return $this->match;
31
    }
32
33
    public function match(): MatchId
34
    {
35
        return $this->aggregateId();
36
    }
37
38
    public function player(): int
39
    {
40
        return $this->player;
41
    }
42
43
    public function card(): CardId
44
    {
45
        return $this->card;
46
    }
47
48
    public function offset(): int
49
    {
50
        return $this->offset;
51
    }
52
}
53