Skip to content

Commit

Permalink
Add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Jan 7, 2025
1 parent c14d38e commit a024a7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Analyzers/PixelColorAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function colorAt(ColorspaceInterface $colorspace, VipsImage $vipsImage
return $this->driver()
->colorProcessor($colorspace)
->nativeToColor(array_map(
fn ($value): int => (int) min($value, 255),
fn(int|float $value): int => (int) min($value, 255),
$vipsImage->getpoint($x, $y)
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/ColorProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(protected ColorspaceInterface $colorspace)
*/
public function colorToNative(ColorInterface $color)
{
return array_map(fn($value) => $value * 255, $color->normalize());
return array_map(fn(float $value) => $value * 255, $color->normalize());
}

/**
Expand Down

0 comments on commit a024a7b

Please sign in to comment.