src/PhoneNumberUtil.php
protected function prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, &$formattedNumber)
    {
        switch ($numberFormat) {
            case PhoneNumberFormat::E164:
                $formattedNumber = static::PLUS_SIGN . $countryCallingCode . $formattedNumber;
                return;
            case PhoneNumberFormat::INTERNATIONAL:
                $formattedNumber = static::PLUS_SIGN . $countryCallingCode . ' ' . $formattedNumber;
                return;
            case PhoneNumberFormat::RFC3966:
                $formattedNumber = static::RFC3966_PREFIX . static::PLUS_SIGN . $countryCallingCode . '-' . $formattedNumber;
                return;
            case PhoneNumberFormat::NATIONAL:
            default:
                return;
        }
    }
protected function prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, &$formattedNumber)
    {
        switch ($numberFormat) {
            case PhoneNumberFormat::E164:
                $formattedNumber = static::PLUS_SIGN . $countryCallingCode . $formattedNumber;
                return;
            case PhoneNumberFormat::INTERNATIONAL:
                $formattedNumber = static::PLUS_SIGN . $countryCallingCode . ' ' . $formattedNumber;
                return;
            case PhoneNumberFormat::RFC3966:
                $formattedNumber = static::RFC3966_PREFIX . static::PLUS_SIGN . $countryCallingCode . '-' . $formattedNumber;
                return;
            case PhoneNumberFormat::NATIONAL:
            default:
                return;
        }
    }
protected function prefixNumberWithCountryCallingCode ( $ countryCallingCode , $ numberFormat , & $ formattedNumber ) { switch ( $ numberFormat ) { case PhoneNumberFormat :: E164 : $ formattedNumber = static :: PLUS_SIGN . $ countryCallingCode . $ formattedNumber ; return ; case PhoneNumberFormat :: INTERNATIONAL : $ formattedNumber = static :: PLUS_SIGN . $ countryCallingCode . ' ' . $ formattedNumber ; return ; case PhoneNumberFormat :: RFC3966 : $ formattedNumber = static :: RFC3966_PREFIX . static :: PLUS_SIGN . $ countryCallingCode . '-' . $ formattedNumber ; return ; case PhoneNumberFormat :: NATIONAL : default : return ; } }
A helper function that is used by format and formatByPattern.
@param int $countryCallingCode
@param int $numberFormat PhoneNumberFormat
@param string $formattedNumber
A helper function that is used by format and formatByPattern .