src/Valkyrja/Enum/Enum.php
protected static function reflectionValidValues(): array
    {
        try {
            // Get a reflection class of the enum
            $reflectionClass = new ReflectionClass(static::class);
            $values          = $reflectionClass->getConstants();
        } // Catch any exceptions
        catch (\Exception $exception) {
            $values = [];
        }

        $validValues = [];

        // Iterate through the values
        foreach ($values as $key => $value) {
            // If this value is defined in this abstract Enum (self)
            if (\defined(self::class . '::' . $key)) {
                // Unset it from the list as its not a valid Enum value, but
                // rather a value the Enum class needs (like self::VALUES)
                unset($values[$key]);

                continue;
            }

            $validValues[$value] = $value;
        }

        return $validValues;
    }
protected static function reflectionValidValues(): array
    {
        try {
            // Get a reflection class of the enum
            $reflectionClass = new ReflectionClass(static::class);
            $values          = $reflectionClass->getConstants();
        } // Catch any exceptions
        catch (\Exception $exception) {
            $values = [];
        }

        $validValues = [];

        // Iterate through the values
        foreach ($values as $key => $value) {
            // If this value is defined in this abstract Enum (self)
            if (\defined(self::class . '::' . $key)) {
                // Unset it from the list as its not a valid Enum value, but
                // rather a value the Enum class needs (like self::VALUES)
                unset($values[$key]);

                continue;
            }

            $validValues[$value] = $value;
        }

        return $validValues;
    }
Get the reflection valid values.

@return array