src/PhoneNumberUtil.php
public function getExampleNumberForNonGeoEntity($countryCallingCode)
    {
        $metadata = $this->getMetadataForNonGeographicalRegion($countryCallingCode);
        if ($metadata !== null) {
            // For geographical entities, fixed-line data is always present. However, for non-geographical
            // entities, this is not the case, so we have to go through different types to find the
            // example number. We don't check fixed-line or personal number since they aren't used by
            // non-geographical entities (if this changes, a unit-test will catch this.)
            /** @var PhoneNumberDesc[] $list */
            $list = array(
                $metadata->getMobile(),
                $metadata->getTollFree(),
                $metadata->getSharedCost(),
                $metadata->getVoip(),
                $metadata->getVoicemail(),
                $metadata->getUan(),
                $metadata->getPremiumRate(),
            );
            foreach ($list as $desc) {
                try {
                    if ($desc !== null && $desc->hasExampleNumber()) {
                        return $this->parse('+' . $countryCallingCode . $desc->getExampleNumber(), self::UNKNOWN_REGION);
                    }
                } catch (NumberParseException $e) {
                    // noop
                }
            }
        }
        return null;
    }
public function getExampleNumberForNonGeoEntity($countryCallingCode)
    {
        $metadata = $this->getMetadataForNonGeographicalRegion($countryCallingCode);
        if ($metadata !== null) {
            // For geographical entities, fixed-line data is always present. However, for non-geographical
            // entities, this is not the case, so we have to go through different types to find the
            // example number. We don't check fixed-line or personal number since they aren't used by
            // non-geographical entities (if this changes, a unit-test will catch this.)
            /** @var PhoneNumberDesc[] $list */
            $list = array(
                $metadata->getMobile(),
                $metadata->getTollFree(),
                $metadata->getSharedCost(),
                $metadata->getVoip(),
                $metadata->getVoicemail(),
                $metadata->getUan(),
                $metadata->getPremiumRate(),
            );
            foreach ($list as $desc) {
                try {
                    if ($desc !== null && $desc->hasExampleNumber()) {
                        return $this->parse('+' . $countryCallingCode . $desc->getExampleNumber(), self::UNKNOWN_REGION);
                    }
                } catch (NumberParseException $e) {
                    // noop
                }
            }
        }
        return null;
    }
public function getExampleNumberForNonGeoEntity ( $ countryCallingCode ) { $ metadata = $ this -> getMetadataForNonGeographicalRegion ( $ countryCallingCode ) ; if ( $ metadata !== null ) { // For geographical entities, fixed-line data is always present. However, for non-geographical // entities, this is not the case, so we have to go through different types to find the // example number. We don't check fixed-line or personal number since they aren't used by // non-geographical entities (if this changes, a unit-test will catch this.) /** @var PhoneNumberDesc[] $list */ $ list = array ( $ metadata -> getMobile ( ) , $ metadata -> getTollFree ( ) , $ metadata -> getSharedCost ( ) , $ metadata -> getVoip ( ) , $ metadata -> getVoicemail ( ) , $ metadata -> getUan ( ) , $ metadata -> getPremiumRate ( ) , ) ; foreach ( $ list as $ desc ) { try { if ( $ desc !== null && $ desc -> hasExampleNumber ( ) ) { return $ this -> parse ( '+' . $ countryCallingCode . $ desc -> getExampleNumber ( ) , self :: UNKNOWN_REGION ) ; } } catch ( NumberParseException $ e ) { // noop } } } return null ; }
Gets a valid number for the specified country calling code for a non-geographical entity.

@param int $countryCallingCode the country calling code for a non-geographical entity
@return PhoneNumber a valid number for the non-geographical entity. Returns null when the metadata
does not contain such information, or the country calling code passed in does not belong
to a non-geographical entity.
Gets a valid number for the specified country calling code for a non - geographical entity .