src/File/ImageOptions.php
public function setResizeFit(string $resizeFit = \null)
    {
        $validValues = ['pad', 'crop', 'fill', 'thumb', 'scale'];

        if (\null !== $resizeFit && !\in_array($resizeFit, $validValues, \true)) {
            throw new \InvalidArgumentException(\sprintf(
                'Unknown resize fit "%s" given. Expected "%s" or null.',
                $resizeFit,
                \implode(', ', $validValues)
            ));
        }

        $this->resizeFit = $resizeFit;

        return $this;
    }
public function setResizeFit(string $resizeFit = \null)
    {
        $validValues = ['pad', 'crop', 'fill', 'thumb', 'scale'];

        if (\null !== $resizeFit && !\in_array($resizeFit, $validValues, \true)) {
            throw new \InvalidArgumentException(\sprintf(
                'Unknown resize fit "%s" given. Expected "%s" or null.',
                $resizeFit,
                \implode(', ', $validValues)
            ));
        }

        $this->resizeFit = $resizeFit;

        return $this;
    }
public function setResizeFit ( string $ resizeFit = \ null ) { $ validValues = [ 'pad' , 'crop' , 'fill' , 'thumb' , 'scale' ] ; if ( \ null !== $ resizeFit && ! \ in_array ( $ resizeFit , $ validValues , \ true ) ) { throw new \ InvalidArgumentException ( \ sprintf ( 'Unknown resize fit "%s" given. Expected "%s" or null.' , $ resizeFit , \ implode ( ', ' , $ validValues ) ) ) ; } $ this -> resizeFit = $ resizeFit ; return $ this ; }
Change the behavior when resizing the image.

By default, images are resized to fit inside the bounding box
set trough setWidth and setHeight while retaining their aspect ratio.

Possible values are:
- null for the default value
- 'pad' Same as the default, but add padding so that the generated image has exactly the given dimensions.
- 'crop' Crop a part of the original image.
- 'fill' Fill the given dimensions by cropping the image.
- 'thumb' Create a thumbnail of detected faces from image, used with 'setFocus'.
- 'scale' Scale the image regardless of the original aspect ratio.

@param string|null $resizeFit

@throws \InvalidArgumentException For unknown values of $resizeBehavior

@return $this
Change the behavior when resizing the image .