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

PlayTheCard   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

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

6 Methods

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