public function expandTo($width, $height=null)
    {
        $size = $width instanceof Size ? $width : new static($width, $height);

        if (!$size->isValid()) {
            return $this->scaleTo($size);
        }

        $myAspectRatio = $this->aspectRatio();

        $newWidth = $size->height() * $myAspectRatio;

        if ($newWidth >= $size->width()) {
            return new static($newWidth, $size->height());
        }

        return new static($size->width(), $size->width() / $myAspectRatio);
    }
public function expandTo($width, $height=null)
    {
        $size = $width instanceof Size ? $width : new static($width, $height);

        if (!$size->isValid()) {
            return $this->scaleTo($size);
        }

        $myAspectRatio = $this->aspectRatio();

        $newWidth = $size->height() * $myAspectRatio;

        if ($newWidth >= $size->width()) {
            return new static($newWidth, $size->height());
        }

        return new static($size->width(), $size->width() / $myAspectRatio);
    }
public function expandTo ( $ width , $ height = null ) { $ size = $ width instanceof Size ? $ width : new static ( $ width , $ height ) ; if ( ! $ size -> isValid ( ) ) { return $ this -> scaleTo ( $ size ) ; } $ myAspectRatio = $ this -> aspectRatio ( ) ; $ newWidth = $ size -> height ( ) * $ myAspectRatio ; if ( $ newWidth >= $ size -> width ( ) ) { return new static ( $ newWidth , $ size -> height ( ) ) ; } return new static ( $ size -> width ( ) , $ size -> width ( ) / $ myAspectRatio ) ; }
Scale the size so that by keeping the aspect ratio it will be bigger then
the passed size. But this in the smallest possible size.
Returns a new Size.

@param float|Size $width
@param float      $height (optional)

@return static
Scale the size so that by keeping the aspect ratio it will be bigger then the passed size . But this in the smallest possible size . Returns a new Size .