diff --git a/src/ImageManipulation.php b/src/ImageManipulation.php index 605126ad..b6c0cd82 100644 --- a/src/ImageManipulation.php +++ b/src/ImageManipulation.php @@ -1037,7 +1037,7 @@ public function variantParts($variantName) throw new InvalidArgumentException('Invalid variant name arguments: ' . $variantName); } - return array_merge([$matches['format']], $args[0]); + return array_merge([$matches['format']], $args); } /** diff --git a/tests/php/ImageTest.php b/tests/php/ImageTest.php index c44da35d..8eb8d928 100644 --- a/tests/php/ImageTest.php +++ b/tests/php/ImageTest.php @@ -419,7 +419,7 @@ public function testVariantParts() $image = singleton(Image::class); $format = 'Pad'; $args = [331, 313, '222222', 0]; - $name = $image->variantName($format, $args); + $name = $image->variantName($format, ...$args); $this->assertEquals( array_merge([$format], $args), $image->variantParts($name) @@ -432,7 +432,7 @@ public function testVariantPartsThrowsOnInvalidName() /** @var Image $image */ $image = singleton(Image::class); $args = ['foo']; - $name = $image->variantName('Invalid', $args); + $name = $image->variantName('Invalid', ...$args); $image->variantParts($name); }