src/File/ImageOptions.php
public function setWidth(int $width = \null)
    {
        if (\null !== $width && $width < 0) {
            throw new \InvalidArgumentException('Width must not be negative.');
        }

        $this->width = $width;

        return $this;
    }
public function setWidth(int $width = \null)
    {
        if (\null !== $width && $width < 0) {
            throw new \InvalidArgumentException('Width must not be negative.');
        }

        $this->width = $width;

        return $this;
    }
public function setWidth ( int $ width = \ null ) { if ( \ null !== $ width && $ width < 0 ) { throw new \ InvalidArgumentException ( 'Width must not be negative.' ) ; } $ this -> width = $ width ; return $ this ; }
Set the width of the image.

The image will by default not be stretched, skewed or enlarged.
Instead it will be fit into the bounding box given by the width
and height parameters.

Can be set to null to not set a width.

@param int|null $width the width in pixel

@throws \InvalidArgumentException If $width is negative

@return $this
Set the width of the image .