__construct( public readonly Color $color, public readonly array $letters, public bool $hand_top, public bool $hand_right, public bool $hand_bottom, public bool $hand_left, ) {} public function rotatedCW(): self { $rotated_letters = [ $this->letters[1], $this->letters[2], $this->letters[3], $this->letters[0] ]; return new self( $this->color, $rotated_letters, $this->hand_left, $this->hand_top, $this->hand_right, $this->hand_bottom ); } public function isValidRotation(): bool { return $this->letters[0] !== null; } public function getLetter(): string { return $this->letters[0]; } }