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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user