original_string: public function set_formats_from_button($formats) {
          $base = $this->base_supported_formats();
          if (count($base) != count($formats)
                  || count($base) != count(array_intersect($base, $formats))) {
                  $this->supportedformats = portfolio_most_specific_formats($formats, $base);
                  return;
          }
          // in the case where the button hasn't actually set anything,
          // we need to run through again and resolve conflicts
          // TODO revisit this comment - it looks to me like it's lying
          $this->supportedformats = portfolio_most_specific_formats($formats, $formats);
      }
code: public function set_formats_from_button($formats) {
          $base = $this->base_supported_formats();
          if (count($base) != count($formats)
                  || count($base) != count(array_intersect($base, $formats))) {
                  $this->supportedformats = portfolio_most_specific_formats($formats, $base);
                  return;
          }
          // in the case where the button hasn't actually set anything,
          // we need to run through again and resolve conflicts
          // TODO revisit this comment - it looks to me like it's lying
          $this->supportedformats = portfolio_most_specific_formats($formats, $formats);
      }
code_tokens: public function set_formats_from_button ( $ formats ) { $ base = $ this -> base_supported_formats ( ) ; if ( count ( $ base ) != count ( $ formats ) || count ( $ base ) != count ( array_intersect ( $ base , $ formats ) ) ) { $ this -> supportedformats = portfolio_most_specific_formats ( $ formats , $ base ) ; return ; } // in the case where the button hasn't actually set anything, // we need to run through again and resolve conflicts // TODO revisit this comment - it looks to me like it's lying $ this -> supportedformats = portfolio_most_specific_formats ( $ formats , $ formats ) ; }
docstring: The button-location always knows best
  what the formats are... so it should be trusted.
  
  @todo MDL-31298 - re-analyze set_formats_from_button comment
  @param array $formats array of PORTFOLIO_FORMAT_XX
  @return void
docstring_tokens: The button - location always knows best what the formats are ... so it should be trusted .