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:
@@ -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) {
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user