build/GeneratePhonePrefixData.php
private function makeDataFallbackToEnglish($textFile, &$mappings)
    {
        $englishPath = $this->getEnglishDataPath($textFile);

        if ($textFile == $englishPath || !file_exists($this->getFilePath($englishPath))) {
            return;
        }

        $countryCode = substr($textFile, 3, 2);

        if (!array_key_exists($countryCode, $this->englishMaps)) {
            $englishMap = $this->readMappingsFromFile($englishPath);

            $this->englishMaps[$countryCode] = $englishMap;
        }

        $this->compressAccordingToEnglishData($this->englishMaps[$countryCode], $mappings);
    }
private function makeDataFallbackToEnglish($textFile, &$mappings)
    {
        $englishPath = $this->getEnglishDataPath($textFile);

        if ($textFile == $englishPath || !file_exists($this->getFilePath($englishPath))) {
            return;
        }

        $countryCode = substr($textFile, 3, 2);

        if (!array_key_exists($countryCode, $this->englishMaps)) {
            $englishMap = $this->readMappingsFromFile($englishPath);

            $this->englishMaps[$countryCode] = $englishMap;
        }

        $this->compressAccordingToEnglishData($this->englishMaps[$countryCode], $mappings);
    }
private function makeDataFallbackToEnglish ( $ textFile , & $ mappings ) { $ englishPath = $ this -> getEnglishDataPath ( $ textFile ) ; if ( $ textFile == $ englishPath || ! file_exists ( $ this -> getFilePath ( $ englishPath ) ) ) { return ; } $ countryCode = substr ( $ textFile , 3 , 2 ) ; if ( ! array_key_exists ( $ countryCode , $ this -> englishMaps ) ) { $ englishMap = $ this -> readMappingsFromFile ( $ englishPath ) ; $ this -> englishMaps [ $ countryCode ] = $ englishMap ; } $ this -> compressAccordingToEnglishData ( $ this -> englishMaps [ $ countryCode ] , $ mappings ) ; }
Compress the provided mappings according to the English data file if any.
@param string $textFile
@param array $mappings
Compress the provided mappings according to the English data file if any .