Assert\Assertion::e164 PHP Метод

e164() публичный статический Метод

Assert that the given string is a valid E164 Phone Number
public static e164 ( string $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value string
$message string | null
$propertyPath string | null
Результат boolean
    public static function e164($value, $message = null, $propertyPath = null)
    {
        if (!preg_match('/^\\+?[1-9]\\d{1,14}$/', $value)) {
            $message = sprintf($message ?: 'Value "%s" is not a valid E164.', static::stringify($value));
            throw static::createException($value, $message, static::INVALID_E164, $propertyPath);
        }
        return true;
    }