diff --git a/modules/Collection/src/ArraySet.php b/modules/Collection/src/ArraySet.php index 33918779..a531d5fa 100644 --- a/modules/Collection/src/ArraySet.php +++ b/modules/Collection/src/ArraySet.php @@ -7,8 +7,6 @@ use Closure; use Elephox\Collection\Contract\GenericSet; use Iterator; -use IteratorIterator; -use Traversable; /** * @template T diff --git a/modules/Collection/src/IsKeyedEnumerable.php b/modules/Collection/src/IsKeyedEnumerable.php index ce476487..e7272abc 100644 --- a/modules/Collection/src/IsKeyedEnumerable.php +++ b/modules/Collection/src/IsKeyedEnumerable.php @@ -34,6 +34,7 @@ use RecursiveIteratorIterator; use Stringable; use Traversable; + use const JSON_FORCE_OBJECT; use const JSON_HEX_AMP; use const JSON_HEX_APOS; diff --git a/modules/Collection/test/ArrayListTest.php b/modules/Collection/test/ArrayListTest.php index 65f3aa78..a54df643 100644 --- a/modules/Collection/test/ArrayListTest.php +++ b/modules/Collection/test/ArrayListTest.php @@ -36,7 +36,7 @@ public function testCount(): void $arr = new ArrayList(['test', 'test2', 'test3']); self::assertCount(3, $arr); - self::assertSame(2, $arr->count(fn ($v) => strlen($v) === 5)); + self::assertSame(2, $arr->count(static fn ($v) => strlen($v) === 5)); } public function testOffsetUnset(): void diff --git a/modules/Collection/test/ArraySetTest.php b/modules/Collection/test/ArraySetTest.php index c6386b70..5de146bd 100644 --- a/modules/Collection/test/ArraySetTest.php +++ b/modules/Collection/test/ArraySetTest.php @@ -84,6 +84,6 @@ public function testCount(): void self::assertCount(3, $set); self::assertSame(3, $set->count()); - self::assertSame(1, $set->count(fn ($v) => $v === 'b')); + self::assertSame(1, $set->count(static fn ($v) => $v === 'b')); } } diff --git a/modules/Collection/test/FlipIteratorTest.php b/modules/Collection/test/FlipIteratorTest.php index 54d01c10..3dc29445 100644 --- a/modules/Collection/test/FlipIteratorTest.php +++ b/modules/Collection/test/FlipIteratorTest.php @@ -19,6 +19,6 @@ public function testGetInnerIterator(): void $it = new ArrayIterator([]); $flip = new FlipIterator($it); - $this->assertSame($it, $flip->getInnerIterator()); + self::assertSame($it, $flip->getInnerIterator()); } } diff --git a/modules/Collection/test/KeySelectIteratorTest.php b/modules/Collection/test/KeySelectIteratorTest.php index da2421cc..c58a6b6c 100644 --- a/modules/Collection/test/KeySelectIteratorTest.php +++ b/modules/Collection/test/KeySelectIteratorTest.php @@ -17,8 +17,8 @@ final class KeySelectIteratorTest extends TestCase public function testGetInnerIterator(): void { $it = new ArrayIterator([]); - $keySelect = new KeySelectIterator($it, fn ($v) => $v); + $keySelect = new KeySelectIterator($it, static fn ($v) => $v); - $this->assertSame($it, $keySelect->getInnerIterator()); + self::assertSame($it, $keySelect->getInnerIterator()); } } diff --git a/modules/Collection/test/SelectIteratorTest.php b/modules/Collection/test/SelectIteratorTest.php index 3f2132e3..ad98cfa8 100644 --- a/modules/Collection/test/SelectIteratorTest.php +++ b/modules/Collection/test/SelectIteratorTest.php @@ -17,8 +17,8 @@ final class SelectIteratorTest extends TestCase public function testGetInnerIterator(): void { $it = new ArrayIterator([]); - $select = new SelectIterator($it, fn ($v) => $v); + $select = new SelectIterator($it, static fn ($v) => $v); - $this->assertSame($it, $select->getInnerIterator()); + self::assertSame($it, $select->getInnerIterator()); } } diff --git a/modules/Collection/test/UniqueByIteratorTest.php b/modules/Collection/test/UniqueByIteratorTest.php index c5711f2f..c168e2c2 100644 --- a/modules/Collection/test/UniqueByIteratorTest.php +++ b/modules/Collection/test/UniqueByIteratorTest.php @@ -25,8 +25,8 @@ public function testIterator(): void public function testGetInnerIterator(): void { $it = new ArrayIterator([]); - $select = new UniqueByIterator($it, fn ($v) => $v, DefaultEqualityComparer::same(...)); + $select = new UniqueByIterator($it, static fn ($v) => $v, DefaultEqualityComparer::same(...)); - $this->assertSame($it, $select->getInnerIterator()); + self::assertSame($it, $select->getInnerIterator()); } }