From bc69b936c5513e1ed4968dfa05813883519b5e5a Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Tue, 3 Oct 2023 10:11:42 +0200 Subject: [PATCH] Remove type check --- src/Traits/CanHandleInput.php | 11 ++--------- .../Abstract/Modifiers/AbstractRotateModifierTest.php | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) 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();