Skip to content

Commit

Permalink
Add type hints on various variables
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed May 1, 2024
1 parent 8e00dd3 commit 55b5208
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Colors/AbstractColorChannel.php
Expand Up @@ -52,7 +52,7 @@ public function value(): int
*
* @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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Cmyk/Colorspace.php
Expand Up @@ -15,7 +15,7 @@

class Colorspace implements ColorspaceInterface
{
public static $channels = [
public static array $channels = [
Channels\Cyan::class,
Channels\Magenta::class,
Channels\Yellow::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Hsl/Colorspace.php
Expand Up @@ -14,7 +14,7 @@

class Colorspace implements ColorspaceInterface
{
public static $channels = [
public static array $channels = [
Channels\Hue::class,
Channels\Saturation::class,
Channels\Luminance::class
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Hsv/Colorspace.php
Expand Up @@ -14,7 +14,7 @@

class Colorspace implements ColorspaceInterface
{
public static $channels = [
public static array $channels = [
Channels\Hue::class,
Channels\Saturation::class,
Channels\Value::class
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Rgb/Colorspace.php
Expand Up @@ -13,7 +13,7 @@

class Colorspace implements ColorspaceInterface
{
public static $channels = [
public static array $channels = [
Channels\Red::class,
Channels\Green::class,
Channels\Blue::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Rgb/Decoders/HtmlColornameDecoder.php
Expand Up @@ -11,7 +11,7 @@

class HtmlColornameDecoder extends HexColorDecoder implements DecoderInterface
{
protected static $names = [
protected static array $names = [
'lightsalmon' => '#ffa07a',
'salmon' => '#fa8072',
'darksalmon' => '#e9967a',
Expand Down
6 changes: 3 additions & 3 deletions src/Drivers/AbstractDecoder.php
Expand Up @@ -156,10 +156,10 @@ protected function parseDataUri(mixed $input): object

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;
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Imagick/Modifiers/ColorspaceModifier.php
Expand Up @@ -15,7 +15,7 @@

class ColorspaceModifier extends GenericColorspaceModifier implements SpecializedInterface
{
protected static $mapping = [
protected static array $mapping = [
RgbColorspace::class => Imagick::COLORSPACE_SRGB,
CmykColorspace::class => Imagick::COLORSPACE_CMYK,
];
Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/Tools/RectangleResizer.php
Expand Up @@ -33,7 +33,7 @@ public function __construct(
/**
* @throws GeometryException
*/
public static function to(...$arguments): self
public static function to(mixed ...$arguments): self
{
return new self(...$arguments);
}
Expand Down

0 comments on commit 55b5208

Please sign in to comment.