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

EndBlocking   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A player() 0 3 1
A match() 0 3 1
A __construct() 0 8 1
A phase() 0 6 1
A correlationId() 0 3 1
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 EndBlocking implements Command
10
{
11
    /** @var MatchId */
12
    private $match;
13
    /** @var int */
14
    private $player;
15
    /** @var CorrelationId */
16
    private $correlationId;
17
18
    public 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
    public static function phase(
29
        MatchId $match,
30
        int $player,
31
        CorrelationId $correlationId
32
    ): self {
33
        return new self($match, $player, $correlationId);
34
    }
35
36
    public function match(): MatchId
37
    {
38
        return $this->match;
39
    }
40
41
    public function player(): int
42
    {
43
        return $this->player;
44
    }
45
46
    public function correlationId(): CorrelationId
47
    {
48
        return $this->correlationId;
49
    }
50
}
51