Total Complexity | 6 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
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 |
||
50 | } |
||
51 | |||
52 | public function correlationId(): CorrelationId |
||
53 | { |
||
54 | return $this->correlationId; |
||
57 |