From b95d9033ab8dd39b1321d6de28a0ea28ebf7ef4c Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 26 Nov 2023 15:21:26 +0100 Subject: [PATCH] Fix bug --- src/Image.php | 8 ++++---- src/Interfaces/ImageInterface.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Image.php b/src/Image.php index 6ba0ca2a..b1f20fc2 100644 --- a/src/Image.php +++ b/src/Image.php @@ -263,22 +263,22 @@ final class Image implements ImageInterface, Countable return $this->encode(new JpegEncoder($quality)); } - public function resize(?int $width, ?int $height): ImageInterface + public function resize(?int $width = null, ?int $height = null): ImageInterface { return $this->modify(new ResizeModifier($width, $height)); } - public function resizeDown(?int $width, ?int $height): ImageInterface + public function resizeDown(?int $width = null, ?int $height = null): ImageInterface { return $this->modify(new ResizeDownModifier($width, $height)); } - public function scale(?int $width, ?int $height): ImageInterface + public function scale(?int $width = null, ?int $height = null): ImageInterface { return $this->modify(new ScaleModifier($width, $height)); } - public function scaleDown(?int $width, ?int $height): ImageInterface + public function scaleDown(?int $width = null, ?int $height = null): ImageInterface { return $this->modify(new ScaleDownModifier($width, $height)); } diff --git a/src/Interfaces/ImageInterface.php b/src/Interfaces/ImageInterface.php index ac34e691..be72095c 100644 --- a/src/Interfaces/ImageInterface.php +++ b/src/Interfaces/ImageInterface.php @@ -287,7 +287,7 @@ interface ImageInterface extends IteratorAggregate, Countable * @param null|int $height * @return ImageInterface */ - public function resize(?int $width, ?int $height): ImageInterface; + public function resize(?int $width = null, ?int $height = null): ImageInterface; /** * Resize image to the given width and/or height without exceeding the original dimensions @@ -296,7 +296,7 @@ interface ImageInterface extends IteratorAggregate, Countable * @param null|int $height * @return ImageInterface */ - public function resizeDown(?int $width, ?int $height): ImageInterface; + public function resizeDown(?int $width = null, ?int $height = null): ImageInterface; /** * Resize image to the given width and/or height and keep the original aspect ratio @@ -305,7 +305,7 @@ interface ImageInterface extends IteratorAggregate, Countable * @param null|int $height * @return ImageInterface */ - public function scale(?int $width, ?int $height): ImageInterface; + public function scale(?int $width = null, ?int $height = null): ImageInterface; /** * Resize image to the given width and/or height, keep the original aspect ratio @@ -315,7 +315,7 @@ interface ImageInterface extends IteratorAggregate, Countable * @param null|int $height * @return ImageInterface */ - public function scaleDown(?int $width, ?int $height): ImageInterface; + public function scaleDown(?int $width = null, ?int $height = null): ImageInterface; /** * Takes the given dimensions and scales it to the largest possible size matching