original_string: public final function contractToMaxSize( Size $maxsize, bool $internal = true )
        : IImage
     {
  
        if ( $maxsize->getWidth()  >= $this->size->getWidth() &&
             $maxsize->getHeight() >= $this->size->getHeight() )
        {
           return $this->returnSelf( $internal );
        }
  
        $newSize = new Size( $this->size->getWidth(), $this->size->getHeight() );
        $newSize->reduceToMaxSize( $maxsize );
  
        return $this->createImageAfterResize( $newSize, $internal );
  
     }
code: public final function contractToMaxSize( Size $maxsize, bool $internal = true )
        : IImage
     {
  
        if ( $maxsize->getWidth()  >= $this->size->getWidth() &&
             $maxsize->getHeight() >= $this->size->getHeight() )
        {
           return $this->returnSelf( $internal );
        }
  
        $newSize = new Size( $this->size->getWidth(), $this->size->getHeight() );
        $newSize->reduceToMaxSize( $maxsize );
  
        return $this->createImageAfterResize( $newSize, $internal );
  
     }
code_tokens: public final function contractToMaxSize ( Size $ maxsize , bool $ internal = true ) : IImage { if ( $ maxsize -> getWidth ( ) >= $ this -> size -> getWidth ( ) && $ maxsize -> getHeight ( ) >= $ this -> size -> getHeight ( ) ) { return $ this -> returnSelf ( $ internal ) ; } $ newSize = new Size ( $ this -> size -> getWidth ( ) , $ this -> size -> getHeight ( ) ) ; $ newSize -> reduceToMaxSize ( $ maxsize ) ; return $ this -> createImageAfterResize ( $ newSize , $ internal ) ; }
docstring: Reduce the original image size by holding the image size proportion, to fit best the declared
  maximum size.
  
  @param  \Beluga\Drawing\Size $maxsize
  @param  bool $internal Do not create a new instance?
  @return \Beluga\Drawing\Image\IImage
  @throws \Beluga\ArgumentError If $maxsize is empty. or bigger than current image
docstring_tokens: Reduce the original image size by holding the image size proportion to fit best the declared maximum size .