src/Valkyrja/Enum/Enum.php
public static function validValues(): array
    {
        // If the const VALUES array has been populated
        if (null !== static::VALUES) {
            // Use it as the developer took the time to define it
            return static::VALUES;
        }

        // Get the class name that was called
        $className = static::class;

        // If the called enum isn't yet cached
        // and the values aren't already set (to avoid a reflection class)
        if (! array_key_exists($className, self::$cache)) {
            // Set the cache to avoid a reflection class creation on each new
            // instance of the enum
            self::$cache[$className] = static::reflectionValidValues();
        }

        return self::$cache[$className] ?? [];
    }
public static function validValues(): array
    {
        // If the const VALUES array has been populated
        if (null !== static::VALUES) {
            // Use it as the developer took the time to define it
            return static::VALUES;
        }

        // Get the class name that was called
        $className = static::class;

        // If the called enum isn't yet cached
        // and the values aren't already set (to avoid a reflection class)
        if (! array_key_exists($className, self::$cache)) {
            // Set the cache to avoid a reflection class creation on each new
            // instance of the enum
            self::$cache[$className] = static::reflectionValidValues();
        }

        return self::$cache[$className] ?? [];
    }
Get the valid values for this enum.

@return array