original_string: public function addAlternative($ratio, Medium $alternative)
      {
          if (!is_numeric($ratio) || $ratio === 0) {
              return;
          }
  
          $alternative->set('ratio', $ratio);
          $width = $alternative->get('width');
  
          $this->alternatives[$width] = $alternative;
      }
code: public function addAlternative($ratio, Medium $alternative)
      {
          if (!is_numeric($ratio) || $ratio === 0) {
              return;
          }
  
          $alternative->set('ratio', $ratio);
          $width = $alternative->get('width');
  
          $this->alternatives[$width] = $alternative;
      }
code_tokens: public function addAlternative ( $ ratio , Medium $ alternative ) { if ( ! is_numeric ( $ ratio ) || $ ratio === 0 ) { return ; } $ alternative -> set ( 'ratio' , $ ratio ) ; $ width = $ alternative -> get ( 'width' ) ; $ this -> alternatives [ $ width ] = $ alternative ; }
docstring: Add alternative Medium to this Medium.
  
  @param int|float $ratio
  @param Medium $alternative
docstring_tokens: Add alternative Medium to this Medium .