| ▲ | columnarx3 6 hours ago | |
I think this is the wrong pattern in this instance. You parse an email or phone number because validating leaves it as a plain string, and you lose the context to know for sure if that string is actually an email or phone number. In your instance, you could have:
In this instance, your logic with a method that accepts birthday and email has all the information it needs to make its choice. | ||