gdbots/pbjc-php

View on GitHub
src/Generator/Twig/js/enum.twig

Summary

Maintainability
Test Coverage
import Enum from '@gdbots/common/Enum';

export default class {{ enum_to_class_name(enum) }} extends Enum {
}

{{ enum_to_class_name(enum) }}.configure({
{% for key, value in enum.values %}
  {{ key|upper }}: {% if enum.type == 'int' %}{{ value }}{% else %}'{{ value }}'{% endif %},
{% endfor %}
}, '{{ enum.getId() }}');