doctrine / doctrine-laminas-hydrator

Doctrine hydrators for Laminas applications
https://www.doctrine-project.org/projects/doctrine-laminas-hydrator.html
MIT License
33 stars 19 forks source link

Add basic support for enums via use of strategies #57

Closed HeyRatFans closed 2 years ago

HeyRatFans commented 2 years ago

This PR adds support for enums via strategies. Inspired by @ezkimo

driehle commented 2 years ago

Thanks @HeyRatFans and @ezkimo, I am still thinking about this change. To me, it seems to break a bit with the current design of this component. Until now, everything worked out of the box without the need to configure strategies. Therefore, I am unsure if we should really break with this approach or if we should investige further to see if we can find a solution that works without the need for configuring strategies.

TomHAnderson commented 2 years ago

Having used this component in many applications, implementing strategies is standard practice. We have already included many strategies in this package. Though an ideal solution would be to support all of PHPs features without further configuration, maintaining backward compatibility is important here. So until we can make the minimum PHP version 8.1, I am for requiring configuration of a strategy for enums as implemented here.

driehle commented 2 years ago

@HeyRatFans I rebased your work onto the latest 3.1.x branch, so that we can bring it into the upcoming 3.1.0 release. Please see PR #59. Could you please add documentation for this new feature?

Ocramius commented 2 years ago

@driehle can this be considered closed now? If so, a release can be cut :+1:

driehle commented 2 years ago

@Ocramius I am closing this PR now, as I just have merged #59. However, bevore a release of 3.1.0 I'd like to have something in the docs about the new enum strategy.