protected function flatten(\ResourceBundle $rb, array &$messages = [], $path = null)
    {
        foreach ($rb as $key => $value) {
            $nodePath = $path ? $path.'.'.$key : $key;
            if ($value instanceof \ResourceBundle) {
                $this->flatten($value, $messages, $nodePath);
            } else {
                $messages[$nodePath] = $value;
            }
        }

        return $messages;
    }
protected function flatten(\ResourceBundle $rb, array &$messages = [], $path = null)
    {
        foreach ($rb as $key => $value) {
            $nodePath = $path ? $path.'.'.$key : $key;
            if ($value instanceof \ResourceBundle) {
                $this->flatten($value, $messages, $nodePath);
            } else {
                $messages[$nodePath] = $value;
            }
        }

        return $messages;
    }
protected function flatten ( \ ResourceBundle $ rb , array & $ messages = [ ] , $ path = null ) { foreach ( $ rb as $ key => $ value ) { $ nodePath = $ path ? $ path . '.' . $ key : $ key ; if ( $ value instanceof \ ResourceBundle ) { $ this -> flatten ( $ value , $ messages , $ nodePath ) ; } else { $ messages [ $ nodePath ] = $ value ; } } return $ messages ; }
Flattens an ResourceBundle.

The scheme used is:
key { key2 { key3 { "value" } } }
Becomes:
'key.key2.key3' => 'value'

This function takes an array by reference and will modify it

@param \ResourceBundle $rb       The ResourceBundle that will be flattened
@param array           $messages Used internally for recursive calls
@param string          $path     Current path being parsed, used internally for recursive calls

@return array the flattened ResourceBundle
Flattens an ResourceBundle .