original_string: public function fitResize($max_width = 150, $max_height = 150, $min_width = 20, $min_height = 20) {
          $kw = $max_width / $this->width();
          $kh = $max_height / $this->height();
          if($kw > $kh) {
              $new_h = $max_height;
              $new_w = round($kh * $this->width());
          } else {
              $new_w = $max_width;
              $new_h = round($kw * $this->height());
          }
          $this->resize($new_w, $new_h);
  
          // Method chaining
          return $this;
      }
code: public function fitResize($max_width = 150, $max_height = 150, $min_width = 20, $min_height = 20) {
          $kw = $max_width / $this->width();
          $kh = $max_height / $this->height();
          if($kw > $kh) {
              $new_h = $max_height;
              $new_w = round($kh * $this->width());
          } else {
              $new_w = $max_width;
              $new_h = round($kw * $this->height());
          }
          $this->resize($new_w, $new_h);
  
          // Method chaining
          return $this;
      }
code_tokens: public function fitResize ( $ max_width = 150 , $ max_height = 150 , $ min_width = 20 , $ min_height = 20 ) { $ kw = $ max_width / $ this -> width ( ) ; $ kh = $ max_height / $ this -> height ( ) ; if ( $ kw > $ kh ) { $ new_h = $ max_height ; $ new_w = round ( $ kh * $ this -> width ( ) ) ; } else { $ new_w = $ max_width ; $ new_h = round ( $ kw * $ this -> height ( ) ) ; } $ this -> resize ( $ new_w , $ new_h ) ; // Method chaining return $ this ; }
docstring: Fit the image with the same proportion into an area
  
  @param int $max_width
  @param int $max_height
  @param int $min_width
  @param int $min_height
  @return Image
docstring_tokens: Fit the image with the same proportion into an area