1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-22 13:32:56 +02:00

Adjust code to meet standard rules

This commit is contained in:
Oliver Vogel
2024-02-01 16:41:14 +01:00
parent f313087160
commit b7c14aaafc
4 changed files with 4 additions and 6 deletions

View File

@@ -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) {

View File

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

View File

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

View File

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