src/Enum.php
protected static function determineKeyToValueMap(): array
    {
        // default behavior is to use all public constants of the current class
        $keyToValueMap = [];

        foreach ((new \ReflectionClass(static::class))->getReflectionConstants() as $constant) {
            if ($constant->isPublic()) {
                $keyToValueMap[$constant->name] = $constant->getValue();
            }
        }

        return $keyToValueMap;
    }
protected static function determineKeyToValueMap(): array
    {
        // default behavior is to use all public constants of the current class
        $keyToValueMap = [];

        foreach ((new \ReflectionClass(static::class))->getReflectionConstants() as $constant) {
            if ($constant->isPublic()) {
                $keyToValueMap[$constant->name] = $constant->getValue();
            }
        }

        return $keyToValueMap;
    }
protected static function determineKeyToValueMap ( ) : array { // default behavior is to use all public constants of the current class $ keyToValueMap = [ ] ; foreach ( ( new \ ReflectionClass ( static :: class ) ) -> getReflectionConstants ( ) as $ constant ) { if ( $ constant -> isPublic ( ) ) { $ keyToValueMap [ $ constant -> name ] = $ constant -> getValue ( ) ; } } return $ keyToValueMap ; }
Determine keys and values containing in this enum

The returned array must have string keys and string|int|null values.

@return array
Determine keys and values containing in this enum