private static function doFlattenArray(array &$values, array $subnode = null, $path = null): void
    {
        if (null === $subnode) {
            $subnode = &$values;
        }
        foreach ($subnode as $key => $value) {
            if (is_array($value)) {
                $nodePath = $path ? $path.'.'.$key : $key;
                static::doFlattenArray($values, $value, $nodePath);
                if (null === $path) {
                    unset($values[$key]);
                }
            } elseif (null !== $path) {
                $values[$path.'.'.$key] = $value;
            }
        }
    }
private static function doFlattenArray(array &$values, array $subnode = null, $path = null): void
    {
        if (null === $subnode) {
            $subnode = &$values;
        }
        foreach ($subnode as $key => $value) {
            if (is_array($value)) {
                $nodePath = $path ? $path.'.'.$key : $key;
                static::doFlattenArray($values, $value, $nodePath);
                if (null === $path) {
                    unset($values[$key]);
                }
            } elseif (null !== $path) {
                $values[$path.'.'.$key] = $value;
            }
        }
    }
private static function doFlattenArray ( array & $ values , array $ subnode = null , $ path = null ) : void { if ( null === $ subnode ) { $ subnode = & $ values ; } foreach ( $ subnode as $ key => $ value ) { if ( is_array ( $ value ) ) { $ nodePath = $ path ? $ path . '.' . $ key : $ key ; static :: doFlattenArray ( $ values , $ value , $ nodePath ) ; if ( null === $ path ) { unset ( $ values [ $ key ] ) ; } } elseif ( null !== $ path ) { $ values [ $ path . '.' . $ key ] = $ value ; } } }
Flattens an nested array of translations.

The scheme used is:
'key' => array('key2' => array('key3' => 'value'))
Becomes:
'key.key2.key3' => 'value'

This function takes an array by reference and will modify it

@param array  &$values The array that will be flattened
@param array  $subnode Current subnode being parsed, used internally for recursive calls
@param string $path    Current path being parsed, used internally for recursive calls
Flattens an nested array of translations .