Completed
Push — master ( 4b1e3c...30d3d2 )
by Jesse
02:57
created

StartedMatchForProposal   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A proposal() 0 3 1
A players() 0 3 1
A __construct() 0 8 1
A aggregateId() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Match\Event;
4
5
use Stratadox\CardGame\Match\MatchEvent;
6
use Stratadox\CardGame\Match\MatchId;
7
use Stratadox\CardGame\Proposal\ProposalId;
8
9
final class StartedMatchForProposal implements MatchEvent
10
{
11
    private $matchId;
12
    private $proposalId;
13
    private $players;
14
15
    public function __construct(
16
        MatchId $matchId,
17
        ProposalId $proposalId,
18
        int ...$players
19
    ) {
20
        $this->matchId = $matchId;
21
        $this->proposalId = $proposalId;
22
        $this->players = $players;
23
    }
24
25
    public function aggregateId(): MatchId
26
    {
27
        return $this->matchId;
28
    }
29
30
    public function proposal(): ProposalId
31
    {
32
        return $this->proposalId;
33
    }
34
35
    /** @return int[] */
36
    public function players(): array
37
    {
38
        return $this->players;
39
    }
40
}
41