Translation/Exporter/YamlExporter.php
protected function flattenArray($array, $prefix = '')
    {
        if (is_array($array)) {
            foreach ($array as $key => $subarray) {
                if (count($array) == 1) {
                    return $this->flattenArray($subarray, ($prefix == '' ? $prefix : $prefix.'.').$key);
                }

                $array[$key] = $this->flattenArray($subarray);
            }
        }

        if ($prefix == '') {
            return $array;
        }

        return array($prefix => $array);
    }
protected function flattenArray($array, $prefix = '')
    {
        if (is_array($array)) {
            foreach ($array as $key => $subarray) {
                if (count($array) == 1) {
                    return $this->flattenArray($subarray, ($prefix == '' ? $prefix : $prefix.'.').$key);
                }

                $array[$key] = $this->flattenArray($subarray);
            }
        }

        if ($prefix == '') {
            return $array;
        }

        return array($prefix => $array);
    }
protected function flattenArray ( $ array , $ prefix = '' ) { if ( is_array ( $ array ) ) { foreach ( $ array as $ key => $ subarray ) { if ( count ( $ array ) == 1 ) { return $ this -> flattenArray ( $ subarray , ( $ prefix == '' ? $ prefix : $ prefix . '.' ) . $ key ) ; } $ array [ $ key ] = $ this -> flattenArray ( $ subarray ) ; } } if ( $ prefix == '' ) { return $ array ; } return array ( $ prefix => $ array ) ; }
Make sure we flatten the array in the begnning to make a lower tree

@param mixed $array
@param string $prefix

@return mixed
Make sure we flatten the array in the begnning to make a lower tree