-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Enum support for ArrayHelper::toArray() #20065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
PR Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20065 +/- ##
============================================
- Coverage 64.82% 64.82% -0.01%
- Complexity 11378 11379 +1
============================================
Files 429 429
Lines 37077 37079 +2
============================================
+ Hits 24037 24038 +1
- Misses 13040 13041 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I think that converting an enum to an array of values makes indeed much more sense than the default behavior. array(3) {
["WhatsApp"]=>
string(8) "whatsapp"
["Viber"]=>
string(5) "viber"
["Telegram"]=>
string(8) "telegram"
} |
Please remember that only BackedEnum has "value", UnitEnum has only "name". |
@uaoleg an you add tests and an entry to changelog? |
Current output of ArrayHelper::toArray is:
Proper way: