diff --git a/src/Drivers/ImageDriver.php b/src/Drivers/ImageDriver.php index e02528cd..e6020d24 100644 --- a/src/Drivers/ImageDriver.php +++ b/src/Drivers/ImageDriver.php @@ -5,6 +5,7 @@ use Spatie\Image\Enums\AlignPosition; use Spatie\Image\Enums\BorderType; use Spatie\Image\Enums\ColorFormat; +use Spatie\Image\Enums\Constraint; use Spatie\Image\Enums\CropPosition; use Spatie\Image\Enums\Fit; use Spatie\Image\Enums\FlipDirection; @@ -89,11 +90,14 @@ public function insert( public function image(): mixed; + /** @param array $constraints */ public function resize(int $width, int $height, array $constraints): self; - public function width(int $width): self; + /** @param array $constraints */ + public function width(int $width, array $constraints = []): self; - public function height(int $height): self; + /** @param array $constraints */ + public function height(int $height, array $constraints = []): self; public function border(int $width, BorderType $type, string $color = '000000'): self; diff --git a/src/Size.php b/src/Size.php index 09e0efee..f1d02965 100644 --- a/src/Size.php +++ b/src/Size.php @@ -20,6 +20,7 @@ public function aspectRatio(): float return $this->width / $this->height; } + /** @param array $constraints */ public function resize( int $desiredWidth = null, int $desiredHeight = null, @@ -46,6 +47,7 @@ public function resize( : $dominantWidthSize; } + /** @param array $constraints */ public function resizeWidth( int $desiredWidth = null, array $constraints = [] @@ -81,6 +83,7 @@ public function resizeWidth( return $this; } + /** @param array $constraints */ public function resizeHeight(int $desiredHeight = null, array $constraints = []): self { $originalWidth = $this->width;