public function acceptInvitation()
    {
        if ($this->isInvitationTokenAccepted()) {
            throw new UserInvitationAlreadyAcceptedException();
        }
        if ($this->isInvitationTokenExpired()) {
            throw new UserTokenExpiredException();
        }
        $this->invitationToken = null;
        $this->updatedOn = new \DateTimeImmutable();
        $this->publish(
            new UserRegistered(
                $this->id(),
                $this->email()
            )
        );
    }