src/precore/lang/Enum.php
final public static function init() : void
    {
        $className = static::class;
        self::$cache[$className] = [];
        $reflectionClass = self::objectClass();
        $constructorParams = static::constructorArgs();
        $ordinal = 0;
        foreach ($reflectionClass->getProperties(ReflectionProperty::IS_STATIC) as $property) {
            if ($property->isPublic()) {
                $name = $property->getName();
                $instance = self::newInstance($name, $constructorParams);
                $property->setValue($instance);
                self::$cache[$className][$name] = $instance;
                self::$ordinals[$className][$name] = $ordinal++;
            }
        }
    }
final public static function init() : void
    {
        $className = static::class;
        self::$cache[$className] = [];
        $reflectionClass = self::objectClass();
        $constructorParams = static::constructorArgs();
        $ordinal = 0;
        foreach ($reflectionClass->getProperties(ReflectionProperty::IS_STATIC) as $property) {
            if ($property->isPublic()) {
                $name = $property->getName();
                $instance = self::newInstance($name, $constructorParams);
                $property->setValue($instance);
                self::$cache[$className][$name] = $instance;
                self::$ordinals[$className][$name] = $ordinal++;
            }
        }
    }
final public static function init ( ) : void { $ className = static :: class ; self :: $ cache [ $ className ] = [ ] ; $ reflectionClass = self :: objectClass ( ) ; $ constructorParams = static :: constructorArgs ( ) ; $ ordinal = 0 ; foreach ( $ reflectionClass -> getProperties ( ReflectionProperty :: IS_STATIC ) as $ property ) { if ( $ property -> isPublic ( ) ) { $ name = $ property -> getName ( ) ; $ instance = self :: newInstance ( $ name , $ constructorParams ) ; $ property -> setValue ( $ instance ) ; self :: $ cache [ $ className ] [ $ name ] = $ instance ; self :: $ ordinals [ $ className ] [ $ name ] = $ ordinal ++ ; } } }
Must be called after your class definition!
Must be called after your class definition!