Skip to content

Commit 9debcfe

Browse files
authored
[9.x] Uses static instead static<TKey, TValue> (#40393)
* Uses static instead static<TKey, TValue> * Fixes variadic PHPDoc type * Uses static instead static<TKey, TValue> in EnumeratesValues trait * Fixes CS
1 parent c910166 commit 9debcfe

File tree

4 files changed

+155
-155
lines changed

4 files changed

+155
-155
lines changed

src/Illuminate/Collections/Collection.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function crossJoin(...$lists)
219219
* Get the items in the collection that are not present in the given items.
220220
*
221221
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
222-
* @return static<TKey, TValue>
222+
* @return static
223223
*/
224224
public function diff($items)
225225
{
@@ -231,7 +231,7 @@ public function diff($items)
231231
*
232232
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
233233
* @param callable(TValue): int $callback
234-
* @return static<TKey, TValue>
234+
* @return static
235235
*/
236236
public function diffUsing($items, callable $callback)
237237
{
@@ -242,7 +242,7 @@ public function diffUsing($items, callable $callback)
242242
* Get the items in the collection whose keys and values are not present in the given items.
243243
*
244244
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
245-
* @return static<TKey, TValue>
245+
* @return static
246246
*/
247247
public function diffAssoc($items)
248248
{
@@ -254,7 +254,7 @@ public function diffAssoc($items)
254254
*
255255
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
256256
* @param callable(TKey): int $callback
257-
* @return static<TKey, TValue>
257+
* @return static
258258
*/
259259
public function diffAssocUsing($items, callable $callback)
260260
{
@@ -265,7 +265,7 @@ public function diffAssocUsing($items, callable $callback)
265265
* Get the items in the collection whose keys are not present in the given items.
266266
*
267267
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
268-
* @return static<TKey, TValue>
268+
* @return static
269269
*/
270270
public function diffKeys($items)
271271
{
@@ -277,7 +277,7 @@ public function diffKeys($items)
277277
*
278278
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
279279
* @param callable(TKey): int $callback
280-
* @return static<TKey, TValue>
280+
* @return static
281281
*/
282282
public function diffKeysUsing($items, callable $callback)
283283
{
@@ -289,7 +289,7 @@ public function diffKeysUsing($items, callable $callback)
289289
*
290290
* @param (callable(TValue): bool)|string|null $callback
291291
* @param bool $strict
292-
* @return static<TKey, TValue>
292+
* @return static
293293
*/
294294
public function duplicates($callback = null, $strict = false)
295295
{
@@ -316,7 +316,7 @@ public function duplicates($callback = null, $strict = false)
316316
* Retrieve duplicate items from the collection using strict comparison.
317317
*
318318
* @param (callable(TValue): bool)|string|null $callback
319-
* @return static<TKey, TValue>
319+
* @return static
320320
*/
321321
public function duplicatesStrict($callback = null)
322322
{
@@ -346,7 +346,7 @@ protected function duplicateComparator($strict)
346346
* Get all items except for those with the specified keys.
347347
*
348348
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys
349-
* @return static<TKey, TValue>
349+
* @return static
350350
*/
351351
public function except($keys)
352352
{
@@ -363,7 +363,7 @@ public function except($keys)
363363
* Run a filter over each of the items.
364364
*
365365
* @param (callable(TValue): bool)|null $callback
366-
* @return static<TKey, TValue>
366+
* @return static
367367
*/
368368
public function filter(callable $callback = null)
369369
{
@@ -577,7 +577,7 @@ public function implode($value, $glue = null)
577577
* Intersect the collection with the given items.
578578
*
579579
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
580-
* @return static<TKey, TValue>
580+
* @return static
581581
*/
582582
public function intersect($items)
583583
{
@@ -588,7 +588,7 @@ public function intersect($items)
588588
* Intersect the collection with the given items by key.
589589
*
590590
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
591-
* @return static<TKey, TValue>
591+
* @return static
592592
*/
593593
public function intersectByKeys($items)
594594
{
@@ -762,7 +762,7 @@ public function mapWithKeys(callable $callback)
762762
* Merge the collection with the given items.
763763
*
764764
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
765-
* @return static<TKey, TValue>
765+
* @return static
766766
*/
767767
public function merge($items)
768768
{
@@ -797,7 +797,7 @@ public function combine($values)
797797
* Union the collection with the given items.
798798
*
799799
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
800-
* @return static<TKey, TValue>
800+
* @return static
801801
*/
802802
public function union($items)
803803
{
@@ -809,7 +809,7 @@ public function union($items)
809809
*
810810
* @param int $step
811811
* @param int $offset
812-
* @return static<TKey, TValue>
812+
* @return static
813813
*/
814814
public function nth($step, $offset = 0)
815815
{
@@ -832,7 +832,7 @@ public function nth($step, $offset = 0)
832832
* Get the items with the specified keys.
833833
*
834834
* @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys
835-
* @return static<TKey, TValue>
835+
* @return static
836836
*/
837837
public function only($keys)
838838
{
@@ -893,7 +893,7 @@ public function prepend($value, $key = null)
893893
/**
894894
* Push one or more items onto the end of the collection.
895895
*
896-
* @param ...TValue $values
896+
* @param TValue ...$values
897897
* @return $this
898898
*/
899899
public function push(...$values)
@@ -909,7 +909,7 @@ public function push(...$values)
909909
* Push all of the given items onto the collection.
910910
*
911911
* @param iterable<array-key, TValue> $source
912-
* @return static<TKey, TValue>
912+
* @return static
913913
*/
914914
public function concat($source)
915915
{
@@ -971,7 +971,7 @@ public function random($number = null)
971971
* Replace the collection items with the given items.
972972
*
973973
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
974-
* @return static<TKey, TValue>
974+
* @return static
975975
*/
976976
public function replace($items)
977977
{
@@ -982,7 +982,7 @@ public function replace($items)
982982
* Recursively replace the collection items with the given items.
983983
*
984984
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
985-
* @return static<TKey, TValue>
985+
* @return static
986986
*/
987987
public function replaceRecursive($items)
988988
{
@@ -992,7 +992,7 @@ public function replaceRecursive($items)
992992
/**
993993
* Reverse items order.
994994
*
995-
* @return static<TKey, TValue>
995+
* @return static
996996
*/
997997
public function reverse()
998998
{
@@ -1052,7 +1052,7 @@ public function shift($count = 1)
10521052
* Shuffle the items in the collection.
10531053
*
10541054
* @param int|null $seed
1055-
* @return static<TKey, TValue>
1055+
* @return static
10561056
*/
10571057
public function shuffle($seed = null)
10581058
{
@@ -1064,7 +1064,7 @@ public function shuffle($seed = null)
10641064
*
10651065
* @param int $size
10661066
* @param int $step
1067-
* @return static<int, static<TKey, TValue>>
1067+
* @return static<int, static>
10681068
*/
10691069
public function sliding($size = 2, $step = 1)
10701070
{
@@ -1079,7 +1079,7 @@ public function sliding($size = 2, $step = 1)
10791079
* Skip the first {$count} items.
10801080
*
10811081
* @param int $count
1082-
* @return static<TKey, TValue>
1082+
* @return static
10831083
*/
10841084
public function skip($count)
10851085
{
@@ -1090,7 +1090,7 @@ public function skip($count)
10901090
* Skip items in the collection until the given condition is met.
10911091
*
10921092
* @param TValue|callable(TValue,TKey): bool $value
1093-
* @return static<TKey, TValue>
1093+
* @return static
10941094
*/
10951095
public function skipUntil($value)
10961096
{
@@ -1101,7 +1101,7 @@ public function skipUntil($value)
11011101
* Skip items in the collection while the given condition is met.
11021102
*
11031103
* @param TValue|callable(TValue,TKey): bool $value
1104-
* @return static<TKey, TValue>
1104+
* @return static
11051105
*/
11061106
public function skipWhile($value)
11071107
{
@@ -1113,7 +1113,7 @@ public function skipWhile($value)
11131113
*
11141114
* @param int $offset
11151115
* @param int|null $length
1116-
* @return static<TKey, TValue>
1116+
* @return static
11171117
*/
11181118
public function slice($offset, $length = null)
11191119
{
@@ -1124,7 +1124,7 @@ public function slice($offset, $length = null)
11241124
* Split a collection into a certain number of groups.
11251125
*
11261126
* @param int $numberOfGroups
1127-
* @return static<int, static<TKey, TValue>>
1127+
* @return static<int, static>
11281128
*/
11291129
public function split($numberOfGroups)
11301130
{
@@ -1161,7 +1161,7 @@ public function split($numberOfGroups)
11611161
* Split a collection into a certain number of groups, and fill the first groups completely.
11621162
*
11631163
* @param int $numberOfGroups
1164-
* @return static<int, static<TKey, TValue>>
1164+
* @return static<int, static>
11651165
*/
11661166
public function splitIn($numberOfGroups)
11671167
{
@@ -1229,7 +1229,7 @@ public function firstOrFail($key = null, $operator = null, $value = null)
12291229
* Chunk the collection into chunks of the given size.
12301230
*
12311231
* @param int $size
1232-
* @return static<int, static<TKey, TValue>>
1232+
* @return static<int, static>
12331233
*/
12341234
public function chunk($size)
12351235
{
@@ -1263,7 +1263,7 @@ public function chunkWhile(callable $callback)
12631263
* Sort through each item with a callback.
12641264
*
12651265
* @param (callable(TValue, TValue): bool)|null|int $callback
1266-
* @return static<TKey, TValue>
1266+
* @return static
12671267
*/
12681268
public function sort($callback = null)
12691269
{
@@ -1280,7 +1280,7 @@ public function sort($callback = null)
12801280
* Sort items in descending order.
12811281
*
12821282
* @param int $options
1283-
* @return static<TKey, TValue>
1283+
* @return static
12841284
*/
12851285
public function sortDesc($options = SORT_REGULAR)
12861286
{
@@ -1297,7 +1297,7 @@ public function sortDesc($options = SORT_REGULAR)
12971297
* @param (callable(TValue, TKey): mixed)|string $callback
12981298
* @param int $options
12991299
* @param bool $descending
1300-
* @return static<TKey, TValue>
1300+
* @return static
13011301
*/
13021302
public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
13031303
{
@@ -1378,7 +1378,7 @@ protected function sortByMany(array $comparisons = [])
13781378
*
13791379
* @param (callable(TValue, TKey): mixed)|string $callback
13801380
* @param int $options
1381-
* @return static<TKey, TValue>
1381+
* @return static
13821382
*/
13831383
public function sortByDesc($callback, $options = SORT_REGULAR)
13841384
{
@@ -1390,7 +1390,7 @@ public function sortByDesc($callback, $options = SORT_REGULAR)
13901390
*
13911391
* @param int $options
13921392
* @param bool $descending
1393-
* @return static<TKey, TValue>
1393+
* @return static
13941394
*/
13951395
public function sortKeys($options = SORT_REGULAR, $descending = false)
13961396
{
@@ -1405,7 +1405,7 @@ public function sortKeys($options = SORT_REGULAR, $descending = false)
14051405
* Sort the collection keys in descending order.
14061406
*
14071407
* @param int $options
1408-
* @return static<TKey, TValue>
1408+
* @return static
14091409
*/
14101410
public function sortKeysDesc($options = SORT_REGULAR)
14111411
{
@@ -1418,7 +1418,7 @@ public function sortKeysDesc($options = SORT_REGULAR)
14181418
* @param int $offset
14191419
* @param int|null $length
14201420
* @param array<array-key, TValue> $replacement
1421-
* @return static<TKey, TValue>
1421+
* @return static
14221422
*/
14231423
public function splice($offset, $length = null, $replacement = [])
14241424
{
@@ -1433,7 +1433,7 @@ public function splice($offset, $length = null, $replacement = [])
14331433
* Take the first or last {$limit} items.
14341434
*
14351435
* @param int $limit
1436-
* @return static<TKey, TValue>
1436+
* @return static
14371437
*/
14381438
public function take($limit)
14391439
{
@@ -1448,7 +1448,7 @@ public function take($limit)
14481448
* Take items in the collection until the given condition is met.
14491449
*
14501450
* @param TValue|callable(TValue,TKey): bool $value
1451-
* @return static<TKey, TValue>
1451+
* @return static
14521452
*/
14531453
public function takeUntil($value)
14541454
{
@@ -1459,7 +1459,7 @@ public function takeUntil($value)
14591459
* Take items in the collection while the given condition is met.
14601460
*
14611461
* @param TValue|callable(TValue,TKey): bool $value
1462-
* @return static<TKey, TValue>
1462+
* @return static
14631463
*/
14641464
public function takeWhile($value)
14651465
{
@@ -1494,7 +1494,7 @@ public function undot()
14941494
*
14951495
* @param (callable(TValue, TKey): bool)|string|null $key
14961496
* @param bool $strict
1497-
* @return static<TKey, TValue>
1497+
* @return static
14981498
*/
14991499
public function unique($key = null, $strict = false)
15001500
{

0 commit comments

Comments
 (0)