Passed
Push — master ( 4e3abd...c23c95 )
by Jesse
02:09
created

EndTheTurn::correlationId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Match\Command;
4
5
use Stratadox\CardGame\Command;
6
use Stratadox\CardGame\CorrelationId;
7
use Stratadox\CardGame\Match\MatchId;
8
9
final class EndTheTurn implements Command
10
{
11
    /** @var MatchId */
12
    private $match;
13
    /** @var int */
14
    private $player;
15
    /** @var CorrelationId */
16
    private $correlationId;
17
18
    private function __construct(
19
        MatchId $match,
20
        int $player,
21
        CorrelationId $correlationId
22
    ) {
23
        $this->match = $match;
24
        $this->player = $player;
25
        $this->correlationId = $correlationId;
26
    }
27
28
29
    public static function for(
30
        MatchId $match,
31
        int $player,
32
        CorrelationId $correlationId
33
    ): self {
34
        return new self($match, $player, $correlationId);
35
    }
36
37
    public function match(): MatchId
38
    {
39
        return $this->match;
40
    }
41
42
    public function player(): int
43
    {
44
        return $this->player;
45
    }
46
47
    public function correlationId(): CorrelationId
48
    {
49
        return $this->correlationId;
50
    }
51
}
52