1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-25 06:40:48 +02:00

Remove type check

This commit is contained in:
Oliver Vogel
2023-10-03 10:11:42 +02:00
parent b57717da3d
commit bc69b936c5
2 changed files with 3 additions and 10 deletions

View File

@@ -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);
}
}

View File

@@ -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();