original_string: protected function findCharset($struct)
      {
          if (isset($struct->parameters)) {
              foreach ($struct->parameters as $param) {
                  if (strtolower($param->attribute) === 'charset') {
                      return strtoupper($param->value);
                  }
              }
          }
          if (isset($struct->dparameters)) {
              foreach ($struct->dparameters as $param) {
                  if (strtolower($param->attribute) === 'charset') {
                      return strtoupper($param->value);
                  }
              }
          }
  
          return '';
      }
code: protected function findCharset($struct)
      {
          if (isset($struct->parameters)) {
              foreach ($struct->parameters as $param) {
                  if (strtolower($param->attribute) === 'charset') {
                      return strtoupper($param->value);
                  }
              }
          }
          if (isset($struct->dparameters)) {
              foreach ($struct->dparameters as $param) {
                  if (strtolower($param->attribute) === 'charset') {
                      return strtoupper($param->value);
                  }
              }
          }
  
          return '';
      }
code_tokens: protected function findCharset ( $ struct ) { if ( isset ( $ struct -> parameters ) ) { foreach ( $ struct -> parameters as $ param ) { if ( strtolower ( $ param -> attribute ) === 'charset' ) { return strtoupper ( $ param -> value ) ; } } } if ( isset ( $ struct -> dparameters ) ) { foreach ( $ struct -> dparameters as $ param ) { if ( strtolower ( $ param -> attribute ) === 'charset' ) { return strtoupper ( $ param -> value ) ; } } } return '' ; }
docstring: Locate the charset within the struct
  
  @param  stdClass $struct
  @return string
docstring_tokens: Locate the charset within the struct