Skip to content

Commit

Permalink
Fixed encoder options
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Mar 26, 2024
1 parent 0dc258c commit f5e243e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Encoders/FilePathEncoder.php
Expand Up @@ -13,14 +13,13 @@ class FilePathEncoder extends FileExtensionEncoder
* Create new encoder instance to encode to format of file extension in given path
*
* @param null|string $path
* @param int $quality
* @return void
*/
public function __construct(protected ?string $path = null, public int $quality = self::DEFAULT_QUALITY)
public function __construct(protected ?string $path = null, mixed ...$options)
{
parent::__construct(
is_null($path) ? $path : pathinfo($path, PATHINFO_EXTENSION),
$quality
...$options
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Image.php
Expand Up @@ -299,7 +299,7 @@ public function encode(EncoderInterface $encoder = new AutoEncoder()): EncodedIm
*
* @see ImageInterface::save()
*/
public function save(?string $path = null, ...$options): ImageInterface
public function save(?string $path = null, mixed ...$options): ImageInterface
{
$path = is_null($path) ? $this->origin()->filePath() : $path;

Expand Down
2 changes: 1 addition & 1 deletion src/Interfaces/ImageInterface.php
Expand Up @@ -88,7 +88,7 @@ public function encode(EncoderInterface $encoder = new AutoEncoder()): EncodedIm
* @throws RuntimeException
* @return ImageInterface
*/
public function save(?string $path = null, ...$options): self;
public function save(?string $path = null, mixed ...$options): self;

/**
* Apply given modifier to current image
Expand Down

0 comments on commit f5e243e

Please sign in to comment.