mirror of
https://github.com/Intervention/image.git
synced 2025-08-20 04:31:24 +02:00
Add type hints on various variables
This commit is contained in:
@@ -52,7 +52,7 @@ abstract class AbstractColorChannel implements ColorChannelInterface
|
||||
*
|
||||
* @see ColorChannelInterface::normalize()
|
||||
*/
|
||||
public function normalize($precision = 32): float
|
||||
public function normalize(int $precision = 32): float
|
||||
{
|
||||
return round(($this->value() - $this->min()) / ($this->max() - $this->min()), $precision);
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ use Intervention\Image\Interfaces\ColorspaceInterface;
|
||||
|
||||
class Colorspace implements ColorspaceInterface
|
||||
{
|
||||
public static $channels = [
|
||||
public static array $channels = [
|
||||
Channels\Cyan::class,
|
||||
Channels\Magenta::class,
|
||||
Channels\Yellow::class,
|
||||
|
@@ -14,7 +14,7 @@ use Intervention\Image\Interfaces\ColorspaceInterface;
|
||||
|
||||
class Colorspace implements ColorspaceInterface
|
||||
{
|
||||
public static $channels = [
|
||||
public static array $channels = [
|
||||
Channels\Hue::class,
|
||||
Channels\Saturation::class,
|
||||
Channels\Luminance::class
|
||||
|
@@ -14,7 +14,7 @@ use Intervention\Image\Interfaces\ColorspaceInterface;
|
||||
|
||||
class Colorspace implements ColorspaceInterface
|
||||
{
|
||||
public static $channels = [
|
||||
public static array $channels = [
|
||||
Channels\Hue::class,
|
||||
Channels\Saturation::class,
|
||||
Channels\Value::class
|
||||
|
@@ -13,7 +13,7 @@ use Intervention\Image\Interfaces\ColorspaceInterface;
|
||||
|
||||
class Colorspace implements ColorspaceInterface
|
||||
{
|
||||
public static $channels = [
|
||||
public static array $channels = [
|
||||
Channels\Red::class,
|
||||
Channels\Green::class,
|
||||
Channels\Blue::class,
|
||||
|
@@ -11,7 +11,7 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
|
||||
class HtmlColornameDecoder extends HexColorDecoder implements DecoderInterface
|
||||
{
|
||||
protected static $names = [
|
||||
protected static array $names = [
|
||||
'lightsalmon' => '#ffa07a',
|
||||
'salmon' => '#fa8072',
|
||||
'darksalmon' => '#e9967a',
|
||||
|
@@ -156,10 +156,10 @@ abstract class AbstractDecoder implements DecoderInterface
|
||||
|
||||
return new class ($matches, $result)
|
||||
{
|
||||
private $matches;
|
||||
private $result;
|
||||
private array $matches;
|
||||
private int|false $result;
|
||||
|
||||
public function __construct($matches, $result)
|
||||
public function __construct(array $matches, int|false $result)
|
||||
{
|
||||
$this->matches = $matches;
|
||||
$this->result = $result;
|
||||
|
@@ -15,7 +15,7 @@ use Intervention\Image\Modifiers\ColorspaceModifier as GenericColorspaceModifier
|
||||
|
||||
class ColorspaceModifier extends GenericColorspaceModifier implements SpecializedInterface
|
||||
{
|
||||
protected static $mapping = [
|
||||
protected static array $mapping = [
|
||||
RgbColorspace::class => Imagick::COLORSPACE_SRGB,
|
||||
CmykColorspace::class => Imagick::COLORSPACE_CMYK,
|
||||
];
|
||||
|
@@ -33,7 +33,7 @@ class RectangleResizer
|
||||
/**
|
||||
* @throws GeometryException
|
||||
*/
|
||||
public static function to(...$arguments): self
|
||||
public static function to(mixed ...$arguments): self
|
||||
{
|
||||
return new self(...$arguments);
|
||||
}
|
||||
|
Reference in New Issue
Block a user