original_string: public function thumbnail($width, $height = null)
      {
          if (!isset($height)) {
              $height = $width;
          }
  
          if (($height / $width) > ($this->height / $this->width)) {
              $this->fitToHeight($height);
          } else {
              $this->fitToWidth($width);
          }
  
          $left = floor(($this->width / 2) - ($width / 2));
          $top = floor(($this->height / 2) - ($height / 2));
  
          return $this->crop($left, $top, $width + $left, $height + $top);
      }
code: public function thumbnail($width, $height = null)
      {
          if (!isset($height)) {
              $height = $width;
          }
  
          if (($height / $width) > ($this->height / $this->width)) {
              $this->fitToHeight($height);
          } else {
              $this->fitToWidth($width);
          }
  
          $left = floor(($this->width / 2) - ($width / 2));
          $top = floor(($this->height / 2) - ($height / 2));
  
          return $this->crop($left, $top, $width + $left, $height + $top);
      }
code_tokens: public function thumbnail ( $ width , $ height = null ) { if ( ! isset ( $ height ) ) { $ height = $ width ; } if ( ( $ height / $ width ) > ( $ this -> height / $ this -> width ) ) { $ this -> fitToHeight ( $ height ) ; } else { $ this -> fitToWidth ( $ width ) ; } $ left = floor ( ( $ this -> width / 2 ) - ( $ width / 2 ) ) ; $ top = floor ( ( $ this -> height / 2 ) - ( $ height / 2 ) ) ; return $ this -> crop ( $ left , $ top , $ width + $ left , $ height + $ top ) ; }
docstring: Create image thumbnail keeping aspect ratio
  @param int $width
  @param int|null $height
  @return $this
docstring_tokens: Create image thumbnail keeping aspect ratio