mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
[phonenumber validation] allow to validate against landline and mobile
phonenumbers
This commit is contained in:
@@ -122,6 +122,24 @@ class PhonenumberHelper
|
||||
return \in_array($validation, [ 'landline', 'voip' ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the phonenumber is a landline or voip phone. Return always false
|
||||
* if the validation is not configured.
|
||||
*
|
||||
* @param string $phonenumber
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidPhonenumberAny($phonenumber) : bool
|
||||
{
|
||||
$validation = $this->performTwilioLookup($phonenumber);
|
||||
|
||||
if (NULL === $validation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return \in_array($validation, [ 'landline', 'voip', 'mobile' ]);
|
||||
}
|
||||
|
||||
public function format($phonenumber)
|
||||
{
|
||||
return $this->performTwilioFormat($phonenumber);
|
||||
|
Reference in New Issue
Block a user