original_string: public static function make_tag($file, $path, $attributes) {
          $srcattr = 'href';
          $tag     = 'a';
          $content = $file->get_filename();
          if (in_array($file->get_mimetype(), portfolio_format_image::mimetypes())) {
              $srcattr = 'src';
              $tag     = 'img';
              $content = '';
          }
  
          $attributes[$srcattr] = $path; // this will override anything we might have been passed (which is good)
          $dom = new DomDocument();
          $elem = null;
          if ($content) {
              $elem = $dom->createElement($tag, $content);
          } else {
              $elem = $dom->createElement($tag);
          }
  
          foreach ($attributes as $key => $value) {
              $elem->setAttribute($key, $value);
          }
          $dom->appendChild($elem);
          return $dom->saveXML($elem);
      }
code: public static function make_tag($file, $path, $attributes) {
          $srcattr = 'href';
          $tag     = 'a';
          $content = $file->get_filename();
          if (in_array($file->get_mimetype(), portfolio_format_image::mimetypes())) {
              $srcattr = 'src';
              $tag     = 'img';
              $content = '';
          }
  
          $attributes[$srcattr] = $path; // this will override anything we might have been passed (which is good)
          $dom = new DomDocument();
          $elem = null;
          if ($content) {
              $elem = $dom->createElement($tag, $content);
          } else {
              $elem = $dom->createElement($tag);
          }
  
          foreach ($attributes as $key => $value) {
              $elem->setAttribute($key, $value);
          }
          $dom->appendChild($elem);
          return $dom->saveXML($elem);
      }
code_tokens: public static function make_tag ( $ file , $ path , $ attributes ) { $ srcattr = 'href' ; $ tag = 'a' ; $ content = $ file -> get_filename ( ) ; if ( in_array ( $ file -> get_mimetype ( ) , portfolio_format_image :: mimetypes ( ) ) ) { $ srcattr = 'src' ; $ tag = 'img' ; $ content = '' ; } $ attributes [ $ srcattr ] = $ path ; // this will override anything we might have been passed (which is good) $ dom = new DomDocument ( ) ; $ elem = null ; if ( $ content ) { $ elem = $ dom -> createElement ( $ tag , $ content ) ; } else { $ elem = $ dom -> createElement ( $ tag ) ; } foreach ( $ attributes as $ key => $ value ) { $ elem -> setAttribute ( $ key , $ value ) ; } $ dom -> appendChild ( $ elem ) ; return $ dom -> saveXML ( $ elem ) ; }
docstring: Create portfolio tag
  
  @param stored_file $file file information object
  @param string $path file path
  @param array $attributes portfolio attributes
  @return string
docstring_tokens: Create portfolio tag