Skip to content

4.x enum helper#116

Merged
ManukMinasyan merged 10 commits intorelaticle:4.xfrom
cheesegrits:4.x-enum-helper
Apr 25, 2026
Merged

4.x enum helper#116
ManukMinasyan merged 10 commits intorelaticle:4.xfrom
cheesegrits:4.x-enum-helper

Conversation

@cheesegrits
Copy link
Copy Markdown
Contributor

Added handling grouping enums to the rebalancer.

I put the convertEnumToString() method in its own helper, as there was nowhere obvious to put it. Happy to move it somewhere else.

Added testing of enums to the rebalancer tests, and a unit test for convertEnumToString().

cheesegrits and others added 10 commits April 15, 2026 19:04
- type EnumHelper::convertEnumToString param as mixed, mark class final, add strict_types
- split BackedEnum / UnitEnum branches, throw InvalidArgumentException on unknown objects
- convert column ids once inside findColumnsNeedingRebalancing so callers don't re-convert
- update unit test to assert the throw
# Conflicts:
#	tests/Fixtures/StatusEnum.php
Laravel ships Illuminate\Support\enum_value() which handles BackedEnum,
UnitEnum, and scalar passthrough — exactly what the helper wrapped.
Cast its mixed return to string at the callsite.
@ManukMinasyan ManukMinasyan merged commit b0805de into relaticle:4.x Apr 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants