Passed
Push — master ( 30d3d2...4e3abd )
by Jesse
01:56
created

AttackWithCard::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\CorrelationId;
6
use Stratadox\CardGame\Match\MatchId;
7
8
final class AttackWithCard
9
{
10
    /** @var int */
11
    private $offset;
12
    /** @var int */
13
    private $player;
14
    /** @var MatchId */
15
    private $match;
16
    /** @var CorrelationId */
17
    private $correlationId;
18
19
    private function __construct(
20
        int $offset,
21
        int $player,
22
        MatchId $match,
23
        CorrelationId $correlationId
24
    ) {
25
        $this->offset = $offset;
26
        $this->player = $player;
27
        $this->match = $match;
28
        $this->correlationId = $correlationId;
29
    }
30
31
    public static function number(
32
        int $offset,
33
        int $player,
34
        MatchId $match,
35
        CorrelationId $correlationId
36
    ): self {
37
        return new self($offset, $player, $match, $correlationId);
38
    }
39
40
    public function cardNumber(): int
41
    {
42
        return $this->offset;
43
    }
44
45
    public function player(): int
46
    {
47
        return $this->player;
48
    }
49
50
    public function match(): MatchId
51
    {
52
        return $this->match;
53
    }
54
55
    public function correlationId(): CorrelationId
56
    {
57
        return $this->correlationId;
58
    }
59
}
60