This PR adds a new method, PhoneNumber::number_type, which attempts to determine the Type of a phone number. I would imagine this is quite a common use-case for the library (for example, a website which accepts phone numbers for account recovery may want to check a provided number is actually a mobile number, and not a premium rate line). The actual implementation just uses the existing validator::number_type function, which is not currently exposed publicly. Thank you!
This PR adds a new method,
PhoneNumber::number_type
, which attempts to determine theType
of a phone number. I would imagine this is quite a common use-case for the library (for example, a website which accepts phone numbers for account recovery may want to check a provided number is actually a mobile number, and not a premium rate line). The actual implementation just uses the existingvalidator::number_type
function, which is not currently exposed publicly. Thank you!