From 2ca57b1e9299afbc9bbc51118341ad111bcee40b Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 31 May 2025 09:59:31 +0200 Subject: [PATCH] Add type hints --- tests/Unit/CollectionTest.php | 2 +- tests/Unit/Modifiers/TextModifierTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Unit/CollectionTest.php b/tests/Unit/CollectionTest.php index 0b36e430..0637cc3b 100644 --- a/tests/Unit/CollectionTest.php +++ b/tests/Unit/CollectionTest.php @@ -51,7 +51,7 @@ final class CollectionTest extends BaseTestCase { $collection = new Collection(['foo', 'bar', 'baz']); $this->assertEquals(3, $collection->count()); - $collection = $collection->filter(function ($text) { + $collection = $collection->filter(function ($text): bool { return substr($text, 0, 1) == 'b'; }); $this->assertEquals(2, $collection->count()); diff --git a/tests/Unit/Modifiers/TextModifierTest.php b/tests/Unit/Modifiers/TextModifierTest.php index 50b3d9ba..a8d98916 100644 --- a/tests/Unit/Modifiers/TextModifierTest.php +++ b/tests/Unit/Modifiers/TextModifierTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Intervention\Image\Tests\Unit\Modifiers; use Intervention\Image\Geometry\Point; +use Intervention\Image\Interfaces\FontInterface; use Intervention\Image\Modifiers\TextModifier; use Intervention\Image\Tests\BaseTestCase; use Intervention\Image\Typography\Font; @@ -17,7 +18,7 @@ final class TextModifierTest extends BaseTestCase { $modifier = new class ('test', new Point(), new Font()) extends TextModifier { - public function testStrokeOffsets($font) + public function testStrokeOffsets(FontInterface $font) { return $this->strokeOffsets($font); }