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

BlockTheAttacker   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A defender() 0 3 1
A attacker() 0 3 1
A player() 0 3 1
A __construct() 0 6 1
A number() 0 7 1
A match() 0 3 1
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