build/BuildMetadataFromXml.php
public static function loadNationalFormat(
        PhoneMetadata $metadata,
        \DOMElement $numberFormatElement,
        NumberFormat $format
    ) {
        self::setLeadingDigitsPatterns($numberFormatElement, $format);
        $format->setPattern(self::validateRE($numberFormatElement->getAttribute(self::PATTERN)));

        $formatPattern = $numberFormatElement->getElementsByTagName(self::FORMAT);
        if ($formatPattern->length != 1) {
            $countryId = strlen($metadata->getId()) > 0 ? $metadata->getId() : $metadata->getCountryCode();
            throw new \RuntimeException('Invalid number of format patterns for country: ' . $countryId);
        }
        $nationalFormat = $formatPattern->item(0)->firstChild->nodeValue;
        $format->setFormat($nationalFormat);
    }
public static function loadNationalFormat(
        PhoneMetadata $metadata,
        \DOMElement $numberFormatElement,
        NumberFormat $format
    ) {
        self::setLeadingDigitsPatterns($numberFormatElement, $format);
        $format->setPattern(self::validateRE($numberFormatElement->getAttribute(self::PATTERN)));

        $formatPattern = $numberFormatElement->getElementsByTagName(self::FORMAT);
        if ($formatPattern->length != 1) {
            $countryId = strlen($metadata->getId()) > 0 ? $metadata->getId() : $metadata->getCountryCode();
            throw new \RuntimeException('Invalid number of format patterns for country: ' . $countryId);
        }
        $nationalFormat = $formatPattern->item(0)->firstChild->nodeValue;
        $format->setFormat($nationalFormat);
    }
public static function loadNationalFormat ( PhoneMetadata $ metadata , \ DOMElement $ numberFormatElement , NumberFormat $ format ) { self :: setLeadingDigitsPatterns ( $ numberFormatElement , $ format ) ; $ format -> setPattern ( self :: validateRE ( $ numberFormatElement -> getAttribute ( self :: PATTERN ) ) ) ; $ formatPattern = $ numberFormatElement -> getElementsByTagName ( self :: FORMAT ) ; if ( $ formatPattern -> length != 1 ) { $ countryId = strlen ( $ metadata -> getId ( ) ) > 0 ? $ metadata -> getId ( ) : $ metadata -> getCountryCode ( ) ; throw new \ RuntimeException ( 'Invalid number of format patterns for country: ' . $ countryId ) ; } $ nationalFormat = $ formatPattern -> item ( 0 ) -> firstChild -> nodeValue ; $ format -> setFormat ( $ nationalFormat ) ; }
Extracts the pattern for the national format.

@internal
@param PhoneMetadata $metadata
@param \DOMElement $numberFormatElement
@param NumberFormat $format
@throws \RuntimeException if multiple or no formats have been encountered.
Extracts the pattern for the national format .