original_string: public function higherQualityAlternative()
      {
          if ($this->alternatives) {
              $max = reset($this->alternatives);
              foreach($this->alternatives as $alternative)
              {
                  if($alternative->quality() > $max->quality())
                  {
                      $max = $alternative;
                  }
              }
  
              return $max;
          }
  
          return $this;
      }
code: public function higherQualityAlternative()
      {
          if ($this->alternatives) {
              $max = reset($this->alternatives);
              foreach($this->alternatives as $alternative)
              {
                  if($alternative->quality() > $max->quality())
                  {
                      $max = $alternative;
                  }
              }
  
              return $max;
          }
  
          return $this;
      }
code_tokens: public function higherQualityAlternative ( ) { if ( $ this -> alternatives ) { $ max = reset ( $ this -> alternatives ) ; foreach ( $ this -> alternatives as $ alternative ) { if ( $ alternative -> quality ( ) > $ max -> quality ( ) ) { $ max = $ alternative ; } } return $ max ; } return $ this ; }
docstring: Return the image higher quality version
  
  @return ImageMedium the alternative version with higher quality
docstring_tokens: Return the image higher quality version