DrHyde / perl-modules-Number-Phone

Number::Phone and friends
24 stars 31 forks source link

Expose the reason for a number being invalid #65

Open Tux opened 7 years ago

Tux commented 7 years ago

It would be awesome is there would be a method or a global that enables me to see the reason for a number not being valid (invalid country code, too long, too short, invalid area code, invalid characters, ...)

DrHyde commented 7 years ago

Yes, it would!

I don't particularly like globals or extra methods for seeing why something failed, so what do you think about using objects that:

and have a reason() method that would return one of a documented set of constants?

Or am I over-thinking this and should just suck up a bit of ugliness?

Tux commented 7 years ago

FINE WITH ME! (capitalized to show enthusiasm)