Skip to content

Commit f409bbb

Browse files
committed
Adds work in progress regarding generic collections
1 parent b93207f commit f409bbb

File tree

8 files changed

+252
-79
lines changed

8 files changed

+252
-79
lines changed

src/Illuminate/Collections/Collection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public function collapse()
166166
* Determine if an item exists in the collection.
167167
*
168168
* @param (callable(TValue): bool)|TValue|string $key
169-
* @param TValue|string|null $operator
170-
* @param TValue|null $value
169+
* @param mixed $operator
170+
* @param mixed $value
171171
* @return bool
172172
*/
173173
public function contains($key, $operator = null, $value = null)
@@ -378,7 +378,7 @@ public function first(callable $callback = null, $default = null)
378378
* Get a flattened array of the items in the collection.
379379
*
380380
* @param int $depth
381-
* @return static<TKey, TValue>
381+
* @return static<int, mixed>
382382
*/
383383
public function flatten($depth = INF)
384384
{
@@ -637,7 +637,7 @@ public function last(callable $callback = null, $default = null)
637637
/**
638638
* Get the values of a given key.
639639
*
640-
* @param string|array<int, string> $value
640+
* @param string|array<array-key, string> $value
641641
* @param string|null $key
642642
* @return static<int, mixed>
643643
*/
@@ -1135,8 +1135,8 @@ public function splitIn($numberOfGroups)
11351135
* Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
11361136
*
11371137
* @param (callable(TValue, TKey): bool)|string $key
1138-
* @param TValue|string|null $operator
1139-
* @param TValue|null $value
1138+
* @param mixed $operator
1139+
* @param mixed $value
11401140
* @return TValue
11411141
*
11421142
* @throws \Illuminate\Support\ItemNotFoundException

src/Illuminate/Collections/Enumerable.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ public function collapse();
116116
/**
117117
* Alias for the "contains" method.
118118
*
119-
* @param (callable(TValue): bool)|TValue|string $key
120-
* @param TValue|string|null $operator
121-
* @param TValue|null $value
119+
* @param (callable(TValue, TKey): bool)|TValue|string $key
120+
* @param mixed $operator
121+
* @param mixed $value
122122
* @return bool
123123
*/
124124
public function some($key, $operator = null, $value = null);
@@ -143,9 +143,9 @@ public function avg($callback = null);
143143
/**
144144
* Determine if an item exists in the enumerable.
145145
*
146-
* @param (callable(TValue): bool)|TValue|string $key
147-
* @param TValue|string|null $operator
148-
* @param TValue|null $value
146+
* @param (callable(TValue, TKey): bool)|TValue|string $key
147+
* @param mixed $operator
148+
* @param mixed $value
149149
* @return bool
150150
*/
151151
public function contains($key, $operator = null, $value = null);
@@ -264,8 +264,8 @@ public function eachSpread(callable $callback);
264264
* Determine if all items pass the given truth test.
265265
*
266266
* @param (callable(TValue, TKey): bool)|TValue|string $key
267-
* @param TValue|string|null $operator
268-
* @param TValue|null $value
267+
* @param mixed $operator
268+
* @param mixed $value
269269
* @return bool
270270
*/
271271
public function every($key, $operator = null, $value = null);
@@ -746,8 +746,8 @@ public function forPage($page, $perPage);
746746
* Partition the collection into two arrays using the given callback or key.
747747
*
748748
* @param (callable(TValue, TKey): bool)|TValue|string $key
749-
* @param TValue|string|null $operator
750-
* @param TValue|null $value
749+
* @param mixed $operator
750+
* @param mixed $value
751751
* @return array<int, static<TKey, TValue>>
752752
*/
753753
public function partition($key, $operator = null, $value = null);
@@ -867,8 +867,8 @@ public function split($numberOfGroups);
867867
* Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
868868
*
869869
* @param (callable(TValue, TKey): bool)|string $key
870-
* @param TValue|string|null $operator
871-
* @param TValue|null $value
870+
* @param mixed $operator
871+
* @param mixed $value
872872
* @return TValue
873873
*
874874
* @throws \Illuminate\Support\ItemNotFoundException
@@ -997,7 +997,7 @@ public function pipe(callable $callback);
997997
/**
998998
* Get the values of a given key.
999999
*
1000-
* @param string|array<int, string> $value
1000+
* @param string|array<array-key, string> $value
10011001
* @param string|null $key
10021002
* @return static<int, mixed>
10031003
*/

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ public function average($callback = null)
174174
/**
175175
* Alias for the "contains" method.
176176
*
177-
* @param (callable(TValue): bool)|TValue|string $key
178-
* @param TValue|string|null $operator
179-
* @param TValue|null $value
177+
* @param (callable(TValue, TKey): bool)|TValue|string $key
178+
* @param mixed $operator
179+
* @param mixed $value
180180
* @return bool
181181
*/
182182
public function some($key, $operator = null, $value = null)
@@ -277,8 +277,8 @@ public function eachSpread(callable $callback)
277277
* Determine if all items pass the given truth test.
278278
*
279279
* @param (callable(TValue, TKey): bool)|TValue|string $key
280-
* @param TValue|string|null $operator
281-
* @param TValue|null $value
280+
* @param mixed $operator
281+
* @param mixed $value
282282
* @return bool
283283
*/
284284
public function every($key, $operator = null, $value = null)

src/Illuminate/Contracts/Queue/QueueableCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public function getQueueableClass();
1414
/**
1515
* Get the identifiers for all of the entities.
1616
*
17-
* @return array
17+
* @return array<int, mixed>
1818
*/
1919
public function getQueueableIds();
2020

2121
/**
2222
* Get the relationships of the entities being queued.
2323
*
24-
* @return array
24+
* @return array<int, string>
2525
*/
2626
public function getQueueableRelations();
2727

0 commit comments

Comments
 (0)