src/Resources/NorthstarUser.php
public function prettyMobile($fallback = '')
    {
        if (! isset($this->mobile)) {
            return $fallback;
        }

        $phoneUtil = PhoneNumberUtil::getInstance();
        try {
            $formattedNumber = $phoneUtil->parse($this->mobile, 'US');

            return $phoneUtil->format($formattedNumber, PhoneNumberFormat::INTERNATIONAL);
        } catch (\libphonenumber\NumberParseException $e) {
            return $this->number;
        }
    }
public function prettyMobile($fallback = '')
    {
        if (! isset($this->mobile)) {
            return $fallback;
        }

        $phoneUtil = PhoneNumberUtil::getInstance();
        try {
            $formattedNumber = $phoneUtil->parse($this->mobile, 'US');

            return $phoneUtil->format($formattedNumber, PhoneNumberFormat::INTERNATIONAL);
        } catch (\libphonenumber\NumberParseException $e) {
            return $this->number;
        }
    }
public function prettyMobile ( $ fallback = '' ) { if ( ! isset ( $ this -> mobile ) ) { return $ fallback ; } $ phoneUtil = PhoneNumberUtil :: getInstance ( ) ; try { $ formattedNumber = $ phoneUtil -> parse ( $ this -> mobile , 'US' ) ; return $ phoneUtil -> format ( $ formattedNumber , PhoneNumberFormat :: INTERNATIONAL ) ; } catch ( \ libphonenumber \ NumberParseException $ e ) { return $ this -> number ; } }
Get the user's formatted mobile number.

@param string $fallback - Text to display if no mobile is set
@return mixed|string
Get the user s formatted mobile number .