PlayTheCard::match()   A
last analyzed

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