original_string: protected function flattenArray(array $array, $separator = null)
      {
          $flattened = array();
  
          if (is_null($separator)) {
              $separator = $this->separator;
          }
  
          foreach ($array as $key => $value) {
              if (is_array($value)) {
                  $flattened = array_merge($flattened, $this->flattenArray($value, $key.$separator));
              } else {
                  $flattened[trim($separator.$key, $this->separator)] = $value;
              }
          }
  
          return $flattened;
      }
code: protected function flattenArray(array $array, $separator = null)
      {
          $flattened = array();
  
          if (is_null($separator)) {
              $separator = $this->separator;
          }
  
          foreach ($array as $key => $value) {
              if (is_array($value)) {
                  $flattened = array_merge($flattened, $this->flattenArray($value, $key.$separator));
              } else {
                  $flattened[trim($separator.$key, $this->separator)] = $value;
              }
          }
  
          return $flattened;
      }
code_tokens: protected function flattenArray ( array $ array , $ separator = null ) { $ flattened = array ( ) ; if ( is_null ( $ separator ) ) { $ separator = $ this -> separator ; } foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ flattened = array_merge ( $ flattened , $ this -> flattenArray ( $ value , $ key . $ separator ) ) ; } else { $ flattened [ trim ( $ separator . $ key , $ this -> separator ) ] = $ value ; } } return $ flattened ; }
docstring: Flatten a nested array to a separated key
  
  @param  array  $array
  @param  string $separator
  @return array
docstring_tokens: Flatten a nested array to a separated key