public static function registerEnumType($name, callable $constructor, callable $serializer = null)
    {
        if (static::hasType($name)) {
            return;
        }

        $serializer = $serializer ?? function ($value) { return ($value === null) ? null : (string)$value; };

        // Register and customize the type
        static::addType($name, static::class);

        /** @var EnumerationBridge $type */
        $type              = static::getType($name);
        $type->name        = $name;
        $type->constructor = $constructor;
        $type->serializer  = $serializer;
    }