protected function mergeTwoParsedFiles($firstParsedData, $secondParsedData)
    {
        $mergedData = $firstParsedData;

        if (is_array($secondParsedData)) {
            foreach ($secondParsedData as $nodeString => $children) {
                if (isset($firstParsedData[$nodeString])) {
                    $mergedData[$nodeString] = $this->mergeTwoParsedFiles($firstParsedData[$nodeString], $children);
                } else {
                    $mergedData[$nodeString] = $children;
                }
            }
        } else {
            $mergedData = $secondParsedData;
        }

        return $mergedData;
    }
protected function mergeTwoParsedFiles($firstParsedData, $secondParsedData)
    {
        $mergedData = $firstParsedData;

        if (is_array($secondParsedData)) {
            foreach ($secondParsedData as $nodeString => $children) {
                if (isset($firstParsedData[$nodeString])) {
                    $mergedData[$nodeString] = $this->mergeTwoParsedFiles($firstParsedData[$nodeString], $children);
                } else {
                    $mergedData[$nodeString] = $children;
                }
            }
        } else {
            $mergedData = $secondParsedData;
        }

        return $mergedData;
    }
protected function mergeTwoParsedFiles ( $ firstParsedData , $ secondParsedData ) { $ mergedData = $ firstParsedData ; if ( is_array ( $ secondParsedData ) ) { foreach ( $ secondParsedData as $ nodeString => $ children ) { if ( isset ( $ firstParsedData [ $ nodeString ] ) ) { $ mergedData [ $ nodeString ] = $ this -> mergeTwoParsedFiles ( $ firstParsedData [ $ nodeString ] , $ children ) ; } else { $ mergedData [ $ nodeString ] = $ children ; } } } else { $ mergedData = $ secondParsedData ; } return $ mergedData ; }
Merges two sets of data from two separate CLDR files into one array.

Merging is done with inheritance in mind, as defined in CLDR specification.

@param mixed $firstParsedData Part of data from first file (either array or string)
@param mixed $secondParsedData Part of data from second file (either array or string)
@return array Data merged from two files
Merges two sets of data from two separate CLDR files into one array .