Skip to content

Commit

Permalink
change interface params to match the actual implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Dec 1, 2023
1 parent 151dfb2 commit 9ab5dee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Drivers/ImageDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -89,11 +90,14 @@ public function insert(

public function image(): mixed;

/** @param array<Constraint> $constraints */
public function resize(int $width, int $height, array $constraints): self;

public function width(int $width): self;
/** @param array<Constraint> $constraints */
public function width(int $width, array $constraints = []): self;

public function height(int $height): self;
/** @param array<Constraint> $constraints */
public function height(int $height, array $constraints = []): self;

public function border(int $width, BorderType $type, string $color = '000000'): self;

Expand Down
3 changes: 3 additions & 0 deletions src/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function aspectRatio(): float
return $this->width / $this->height;
}

/** @param array<Constraint> $constraints */
public function resize(
int $desiredWidth = null,
int $desiredHeight = null,
Expand All @@ -46,6 +47,7 @@ public function resize(
: $dominantWidthSize;
}

/** @param array<Constraint> $constraints */
public function resizeWidth(
int $desiredWidth = null,
array $constraints = []
Expand Down Expand Up @@ -81,6 +83,7 @@ public function resizeWidth(
return $this;
}

/** @param array<Constraint> $constraints */
public function resizeHeight(int $desiredHeight = null, array $constraints = []): self
{
$originalWidth = $this->width;
Expand Down

0 comments on commit 9ab5dee

Please sign in to comment.