BlockTheAttacker   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

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