final public static function createByName(string $name)
    {
        $canonicalName = strtoupper($name);
        if ($canonicalName !== $name) {
            $name = $canonicalName;
            trigger_error('PSR-1 requires constant to be declared in upper case.', E_USER_NOTICE);
        }

        $const = static::getConstList();

        if (!\in_array($name, $const, true)) {
            throw EnumException::becauseUnknownMember(static::class, $name);
        }

        return static::createNamedInstance($name);
    }