mirror of
https://github.com/Intervention/image.git
synced 2025-08-24 06:22:57 +02:00
Add type hint
This commit is contained in:
@@ -17,7 +17,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -17,7 +17,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -17,7 +17,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -17,7 +17,7 @@ class HexColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -157,7 +157,7 @@ class HtmlColornameDecoder extends HexColorDecoder implements DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -17,7 +17,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -8,7 +8,7 @@ use Intervention\Image\Interfaces\ColorInterface;
|
||||
|
||||
class TransparentColorDecoder extends HexColorDecoder
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -9,7 +9,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class Base64ImageDecoder extends BinaryImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! $this->isValidBase64($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -17,7 +17,7 @@ use Intervention\Image\Origin;
|
||||
|
||||
class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (!is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class ColorObjectDecoder extends AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_a($input, ColorInterface::class)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -9,7 +9,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class DataUriImageDecoder extends BinaryImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (!is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class FilePathImageDecoder extends BinaryImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -8,7 +8,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class FilePointerImageDecoder extends BinaryImageDecoder
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (!is_resource($input) || !in_array(get_resource_type($input), ['file', 'stream'])) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class ImageObjectDecoder extends AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_a($input, ImageInterface::class)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class SplFileInfoImageDecoder extends FilePathImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_a($input, SplFileInfo::class)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -9,7 +9,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class Base64ImageDecoder extends BinaryImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! $this->isValidBase64($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -16,7 +16,7 @@ use Intervention\Image\Origin;
|
||||
|
||||
class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (!is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class ColorObjectDecoder extends AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_a($input, ColorInterface::class)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -9,7 +9,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class DataUriImageDecoder extends BinaryImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (!is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class FilePathImageDecoder extends BinaryImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_string($input)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -8,7 +8,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class FilePointerImageDecoder extends BinaryImageDecoder
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (!is_resource($input) || !in_array(get_resource_type($input), ['file', 'stream'])) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class ImageObjectDecoder extends AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_a($input, ImageInterface::class)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class SplFileInfoImageDecoder extends FilePathImageDecoder implements DecoderInterface
|
||||
{
|
||||
public function decode($input): ImageInterface|ColorInterface
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||
{
|
||||
if (! is_a($input, SplFileInfo::class)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
|
@@ -10,5 +10,5 @@ interface DecoderInterface
|
||||
* @param mixed $input
|
||||
* @return ImageInterface|ColorInterface
|
||||
*/
|
||||
public function decode($input): ImageInterface|ColorInterface;
|
||||
public function decode(mixed $input): ImageInterface|ColorInterface;
|
||||
}
|
||||
|
Reference in New Issue
Block a user