Skip to content

Commit 3bf2260

Browse files
committed
tests: fix groupBy/keyBy collection generics
1 parent 48647fb commit 3bf2260

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Type/data/collection-generic-static-methods.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ function test(
6161
assertType('Illuminate\Support\Collection<App\User, int>', $collection->flip());
6262
assertType('Illuminate\Support\Collection<int, string>', $items->flip());
6363

64-
assertType('Illuminate\Database\Eloquent\Collection<(int|string), Illuminate\Database\Eloquent\Collection<(int|string), App\User>>', $collection->groupBy('id'));
65-
assertType('Illuminate\Support\Collection<(int|string), Illuminate\Support\Collection<(int|string), int>>', $items->groupBy('id'));
64+
assertType('Illuminate\Database\Eloquent\Collection<(int|string), Illuminate\Database\Eloquent\Collection<int, App\User>>', $collection->groupBy('id'));
65+
assertType('Illuminate\Support\Collection<(int|string), Illuminate\Support\Collection<int, int>>', $items->groupBy('id'));
6666

67-
assertType('Illuminate\Database\Eloquent\Collection<(int|string), App\User>', $collection->keyBy(fn (User $user, int $key): string => $user->email));
67+
assertType('Illuminate\Database\Eloquent\Collection<string, App\User>', $collection->keyBy(fn (User $user, int $key): string => $user->email));
6868

6969
assertType('Illuminate\Support\Collection<int, int>', $collection->keys());
7070
assertType('Illuminate\Support\Collection<int, string>', $items->keys());
@@ -227,7 +227,7 @@ function test(
227227
LazyCollection::times(10, fn ($int) => 5)->flatMap(fn (int $i) => [$i * 2]),
228228
);
229229

230-
assertType('Illuminate\Support\Collection<(int|string), Illuminate\Support\Collection<(int|string), array{id: int, type: string}>>', collect([
230+
assertType('Illuminate\Support\Collection<(int|string), Illuminate\Support\Collection<int, array{id: int, type: string}>>', collect([
231231
[
232232
'id' => 1,
233233
'type' => 'A',

0 commit comments

Comments
 (0)