original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Flattens an ResourceBundle .