php-schema2class icon indicating copy to clipboard operation
php-schema2class copied to clipboard

EnumGenerator is immutable

Open simivar opened this issue 1 year ago • 1 comments

We are currently facing an issue with the EnumGenerator from the Laminas package. This is the only generator that is immutable and, as a result, it causes challenges when using the onEnumCreated hook. To modify any of the properties one is required to use Reflection

To address this, we propose introducing our own EnumGenerator based on the amazing nikic/PHP-Parser package. The benefits of doing this are:

  1. we can gain greater control and flexibility over the generator
  2. we can add almost any statement to the generated enum
  3. we can provide the end user with more customizability

What do you think?

simivar avatar Nov 11 '24 22:11 simivar