| Total Complexity | 7 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class History |
||
| 10 | { |
||
| 11 | private HistoryId $historyId; |
||
| 12 | private PlayerId $playerId; |
||
| 13 | private DateTimeImmutable $createdAt; |
||
| 14 | private DateTimeImmutable $updatedAt; |
||
| 15 | private int $level; |
||
| 16 | |||
| 17 | public function __construct(HistoryId $historyId) |
||
| 18 | { |
||
| 19 | $this->historyId = $historyId; |
||
| 20 | $this->createdAt = new DateTimeImmutable(); |
||
| 21 | $this->updatedAt = new DateTimeImmutable(); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function changeLevel(int $level): void |
||
| 29 | } |
||
| 30 | |||
| 31 | public function changePlayer(PlayerId $playerId): void |
||
| 32 | { |
||
| 33 | $this->playerId = $playerId; |
||
| 34 | |||
| 35 | $this->updatedAt = new DateTimeImmutable(); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function historyId(): HistoryId |
||
| 39 | { |
||
| 40 | return $this->historyId; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function level(): int |
||
| 46 | } |
||
| 47 | |||
| 48 | public function createdAt(): DateTimeImmutable |
||
| 51 | } |
||
| 52 | |||
| 53 | public function updatedAt(): DateTimeImmutable |
||
| 56 | } |
||
| 57 | } |
||
| 58 |