allows passing an enum to randomElement() or randomElements()#620
Conversation
randomElement() or randomElements()
randomElement() or randomElements()enum to randomElement() or randomElements()
|
@localheinz is there I need to do with the failing pipeline items? The Didn't look into the \Traversable thing too closely. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
localheinz
left a comment
There was a problem hiding this comment.
I think we can simplify this a bit, but it looks good to me otherwise!
Thanks @localheinz! |
eea2bd5 to
f58c881
Compare
src/Faker/Provider/Base.php
Outdated
| $arr = $array; | ||
|
|
||
| if (is_string($array) && function_exists('enum_exists') && enum_exists($array)) { | ||
| $traversables = $array::cases(); |
There was a problem hiding this comment.
If we change this to $arr = $traversables = $array::cases() the test passes, but I'm still unsure why it was failing in the first place
|
I find the code hard to understand in the first place and I am trying to clean it up in #639! |
2f21b41 to
3ac0b61
Compare
Co-authored-by: Andreas Möller <am@localheinz.com>
Co-authored-by: Andreas Möller <am@localheinz.com>
splits tests, splits phases of tests, adds more specific assertions Co-authored-by: Andreas Möller <am@localheinz.com>
Co-authored-by: Andreas Möller <am@localheinz.com>
5460815 to
021e8d3
Compare
|
Thank you, @cosmastech! |
What is the reason for this PR?
is fine, but I think it would be even nicer to have
Author's checklist
Traversables andEnums fakerphp.github.io#85Summary of changes
Review checklist