1
0
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:
Oliver Vogel
2023-12-16 17:27:42 +01:00
parent 3de73efee5
commit 9ba9a05f35
24 changed files with 24 additions and 24 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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