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

BlockTheAttacker::number()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 5
dl 0
loc 8
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 BlockTheAttacker
9
{
10
    /** @var int */
11
    private $defender;
12
    /** @var int */
13
    private $attacker;
14
    /** @var int */
15
    private $player;
16
    /** @var MatchId */
17
    private $match;
18
    /** @var CorrelationId */
19
    private $correlationId;
20
21
    private function __construct(
22
        int $defender,
23
        int $attacker,
24
        int $player,
25
        MatchId $match,
26
        CorrelationId $correlationId
27
    ) {
28
        $this->defender = $defender;
29
        $this->attacker = $attacker;
30
        $this->player = $player;
31
        $this->match = $match;
32
        $this->correlationId = $correlationId;
33
    }
34
35
36
    public static function number(
37
        int $attacker,
38
        int $defender,
39
        int $player,
40
        MatchId $match,
41
        CorrelationId $correlationId
42
    ): self {
43
        return new self($defender, $attacker, $player, $match, $correlationId);
44
    }
45
46
    public function defender(): int
47
    {
48
        return $this->defender;
49
    }
50
51
    public function attacker(): int
52
    {
53
        return $this->attacker;
54
    }
55
56
    public function player(): int
57
    {
58
        return $this->player;
59
    }
60
61
    public function match(): MatchId
62
    {
63
        return $this->match;
64
    }
65
66
    public function correlationId(): CorrelationId
67
    {
68
        return $this->correlationId;
69
    }
70
}
71