mirror of
https://github.com/Intervention/image.git
synced 2025-08-26 07:14:31 +02:00
Remove type check
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Intervention\Image\Traits;
|
namespace Intervention\Image\Traits;
|
||||||
|
|
||||||
use Intervention\Image\Exceptions\DecoderException;
|
|
||||||
use Intervention\Image\Interfaces\ColorInterface;
|
use Intervention\Image\Interfaces\ColorInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
|
||||||
@@ -10,14 +9,8 @@ trait CanHandleInput
|
|||||||
{
|
{
|
||||||
use CanResolveDriverClass;
|
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);
|
return $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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,7 @@ final class AbstractRotateModifierTest extends TestCase
|
|||||||
return parent::backgroundColor();
|
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') {
|
if ($this->background === 'bad value') {
|
||||||
throw new DecoderException();
|
throw new DecoderException();
|
||||||
|
Reference in New Issue
Block a user