Doctrineum/Scalar/ScalarEnumType.php
public static function registerSubTypeEnum(string $subTypeEnumClass, string $subTypeEnumValueRegexp): bool
    {
        if (!static::hasSubTypeEnum($subTypeEnumClass, $subTypeEnumValueRegexp)) {
            // registering same subtype enum class but with different regexp cause exception in following method
            return static::addSubTypeEnum($subTypeEnumClass, $subTypeEnumValueRegexp);
        }

        return false;
    }
public static function registerSubTypeEnum(string $subTypeEnumClass, string $subTypeEnumValueRegexp): bool
    {
        if (!static::hasSubTypeEnum($subTypeEnumClass, $subTypeEnumValueRegexp)) {
            // registering same subtype enum class but with different regexp cause exception in following method
            return static::addSubTypeEnum($subTypeEnumClass, $subTypeEnumValueRegexp);
        }

        return false;
    }
You can register a class just once.

@param string $subTypeEnumClass
@param string $subTypeEnumValueRegexp
@return bool
@throws \Doctrineum\Scalar\Exceptions\SubTypeEnumIsAlreadyRegistered
@throws \Doctrineum\Scalar\Exceptions\SubTypeEnumClassNotFound
@throws \Doctrineum\Scalar\Exceptions\SubTypeEnumHasToBeEnum
@throws \Doctrineum\Scalar\Exceptions\InvalidRegexpFormat