public static function parse(string $phoneNumber, string $regionCode = null) : PhoneNumber
    {
        try {
            return new PhoneNumber(
                PhoneNumberUtil::getInstance()->parse($phoneNumber, $regionCode)
            );
        } catch (NumberParseException $e) {
            throw PhoneNumberParseException::wrap($e);
        }
    }
public static function parse(string $phoneNumber, string $regionCode = null) : PhoneNumber
    {
        try {
            return new PhoneNumber(
                PhoneNumberUtil::getInstance()->parse($phoneNumber, $regionCode)
            );
        } catch (NumberParseException $e) {
            throw PhoneNumberParseException::wrap($e);
        }
    }
public static function parse ( string $ phoneNumber , string $ regionCode = null ) : PhoneNumber { try { return new PhoneNumber ( PhoneNumberUtil :: getInstance ( ) -> parse ( $ phoneNumber , $ regionCode ) ) ; } catch ( NumberParseException $ e ) { throw PhoneNumberParseException :: wrap ( $ e ) ; } }
Parses a string representation of a phone number.

@param string      $phoneNumber The phone number to parse.
@param string|null $regionCode  The region code to assume, if the number is not in international format.

@return PhoneNumber

@throws PhoneNumberParseException
Parses a string representation of a phone number .