Lines
100.00%
5 / 5
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| toMessage | 100.00% | 4 / 4 | 100.00% | 1 / 1 | 1 | ||
| 14 | final readonly class JoinMapCommand implements Command | |
| 15 | { | |
| 16 | /** @param Option<RoomId> $room */ | |
| 17 | public function __construct( | |
| 18 | private PlayerName $playerName, | |
| 19 | private MapName $mapName, | |
| 20 | private Option $room, | |
| 21 | ) {} | |
| 22 | ||
| 23 | #[Override] | |
| 24 | public function toMessage(): string | |
| 25 | { | |
| 26 | return $this->room->proceed( | |
| 27 | fn(RoomId $room) => "%xt%zm%cmd%1%tfer%{$this->playerName}%{$this->mapName}-{$room}%", | |
| 28 | fn() => "%xt%zm%cmd%1%tfer%{$this->playerName}%{$this->mapName}%", | |
| 29 | ); | |
| 30 | } | |
| 31 | } |