public function setType(?string $type): self {
        $validTypesString = str_replace(' and ', ' or ', Text::toList(static::VALID_TYPES));
        if (!in_array($type, static::VALID_TYPES) && !empty($type)) {
            throw new InvalidArgumentException("Type must be $validTypesString. Found: '$type'.");
        }