diff --git a/src/Colors/AbstractColorChannel.php b/src/Colors/AbstractColorChannel.php index ef0ba701..da43f031 100644 --- a/src/Colors/AbstractColorChannel.php +++ b/src/Colors/AbstractColorChannel.php @@ -16,7 +16,7 @@ abstract class AbstractColorChannel implements ColorChannelInterface * * @see ColorChannelInterface::__construct() */ - public function __construct(int $value = null, float $normalized = null) + public function __construct(?int $value = null, ?float $normalized = null) { $this->value = $this->validate( match (true) { diff --git a/src/Drivers/AbstractTextModifier.php b/src/Drivers/AbstractTextModifier.php index 1e179e3e..77197273 100644 --- a/src/Drivers/AbstractTextModifier.php +++ b/src/Drivers/AbstractTextModifier.php @@ -97,7 +97,7 @@ abstract class AbstractTextModifier extends DriverSpecialized implements Modifie * @param Point|null $pivot * @return Polygon */ - public function boundingBox(TextBlock $block, Point $pivot = null): Polygon + public function boundingBox(TextBlock $block, ?Point $pivot = null): Polygon { $pivot = $pivot ? $pivot : new Point(); diff --git a/src/Drivers/Gd/Decoders/BinaryImageDecoder.php b/src/Drivers/Gd/Decoders/BinaryImageDecoder.php index 5933bc16..05fe9a22 100644 --- a/src/Drivers/Gd/Decoders/BinaryImageDecoder.php +++ b/src/Drivers/Gd/Decoders/BinaryImageDecoder.php @@ -26,12 +26,10 @@ class BinaryImageDecoder extends GdImageDecoder implements DecoderInterface throw new DecoderException('Unable to decode input'); } - $image = match ($this->isGifFormat($input)) { + return match ($this->isGifFormat($input)) { true => $this->decodeGif($input), default => $this->decodeBinary($input), }; - - return $image; } /** diff --git a/src/Interfaces/ColorChannelInterface.php b/src/Interfaces/ColorChannelInterface.php index 669591b4..da358d8f 100644 --- a/src/Interfaces/ColorChannelInterface.php +++ b/src/Interfaces/ColorChannelInterface.php @@ -12,7 +12,7 @@ interface ColorChannelInterface * @param int|null $value * @param float|null $normalized */ - public function __construct(int $value = null, float $normalized = null); + public function __construct(?int $value = null, ?float $normalized = null); /** * Return color channels integer value