Switch operator usage
GSpecDrum opened this issue · 2 comments
GSpecDrum commented
Hello! Thanks for this library!
I have a question:
May I use this enums in switch operators? Have usage of this library with switch operator some pitfalls?
Gummibeer commented
Hey,
yes you can use the enums in a switch statement like follows:
switch(Gender::MALE()) {
case Gender::FEMALE():
return 'female';
case Gender::MALE():
return 'male';
}That's just a super stupid example but tested in a project and it perfectly works. 🙂
GSpecDrum commented
Thanks for fast and clear answer!