php-schema2class
php-schema2class copied to clipboard
EnumGenerator is immutable
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:
- we can gain greater control and flexibility over the generator
- we can add almost any statement to the generated enum
- we can provide the end user with more customizability
What do you think?