diff --git a/src/Traits/CanHandleInput.php b/src/Traits/CanHandleInput.php index 9ff2f75b..42edc18a 100644 --- a/src/Traits/CanHandleInput.php +++ b/src/Traits/CanHandleInput.php @@ -2,7 +2,6 @@ namespace Intervention\Image\Traits; -use Intervention\Image\Exceptions\DecoderException; use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Interfaces\ImageInterface; @@ -10,14 +9,8 @@ trait CanHandleInput { use CanResolveDriverClass; - public function handleInput($input, ?string $check_result_against_classname = null): ImageInterface|ColorInterface + public function handleInput($input): ImageInterface|ColorInterface { - $result = $this->resolveDriverClass('InputHandler')->handle($input); - - if (!is_null($check_result_against_classname) && get_class($result) != $check_result_against_classname) { - throw new DecoderException('Decoded result is not an instance of ' . $check_result_against_classname); - } - - return $result; + return $this->resolveDriverClass('InputHandler')->handle($input); } } diff --git a/tests/Drivers/Abstract/Modifiers/AbstractRotateModifierTest.php b/tests/Drivers/Abstract/Modifiers/AbstractRotateModifierTest.php index 554e95f9..42de945b 100644 --- a/tests/Drivers/Abstract/Modifiers/AbstractRotateModifierTest.php +++ b/tests/Drivers/Abstract/Modifiers/AbstractRotateModifierTest.php @@ -64,7 +64,7 @@ final class AbstractRotateModifierTest extends TestCase return parent::backgroundColor(); } - public function handleInput($input, ?string $check_result_against_classname = null): ImageInterface|ColorInterface + public function handleInput($input): ImageInterface|ColorInterface { if ($this->background === 'bad value') { throw new DecoderException();