src/precore/lang/Enum.php
final public static function valueOf($name) : self
    {
        $className = static::class;
        Preconditions::checkArgument(
            array_key_exists($className, self::$cache) && array_key_exists($name, self::$cache[$className]),
            "The enum '%s' type has no constant with name '%s'",
            $className,
            $name
        );
        return self::$cache[$className][$name];
    }
final public static function valueOf($name) : self
    {
        $className = static::class;
        Preconditions::checkArgument(
            array_key_exists($className, self::$cache) && array_key_exists($name, self::$cache[$className]),
            "The enum '%s' type has no constant with name '%s'",
            $className,
            $name
        );
        return self::$cache[$className][$name];
    }
You can obtain the appropriate instance by their name.

@param string $name
@return static
@throws InvalidArgumentException