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

BlockTheAttacker::attacker()   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\Match\MatchId;
6
7
final class BlockTheAttacker
8
{
9
    /** @var int */
10
    private $defender;
11
    /** @var int */
12
    private $attacker;
13
    /** @var int */
14
    private $player;
15
    /** @var MatchId */
16
    private $match;
17
18
    public function __construct(int $defender, int $attacker, int $player, MatchId $match)
19
    {
20
        $this->defender = $defender;
21
        $this->attacker = $attacker;
22
        $this->player = $player;
23
        $this->match = $match;
24
    }
25
26
    public static function number(
27
        int $attacker,
28
        int $defender,
29
        int $player,
30
        MatchId $match
31
    ): self {
32
        return new self($defender, $attacker, $player, $match);
33
    }
34
35
    public function defender(): int
36
    {
37
        return $this->defender;
38
    }
39
40
    public function attacker(): int
41
    {
42
        return $this->attacker;
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