You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -250,12 +252,13 @@ public function flatten(): self
250
252
/**
251
253
* An extra variant of `map` which unpacks arrays into arguments. Flattens inputs if no callback provided.
252
254
*
255
+
* @template TUnpackKey
253
256
* @template TUnpack
254
257
*
255
-
* @param null|callable(mixed...): (TUnpack|Generator<array-key, TUnpack, mixed, mixed>) $func A callback that accepts any number of arguments and returns a single value.
258
+
* @param null|callable(mixed...): (TUnpack|Generator<TUnpackKey, TUnpack, mixed, mixed>) $func A callback that accepts any number of arguments and returns a single value.
256
259
*
257
-
* @phpstan-self-out self<TUnpack>
258
-
* @return Standard<TUnpack>
260
+
* @phpstan-self-out self<TUnpackKey, TUnpack>
261
+
* @return Standard<TUnpackKey, TUnpack>
259
262
*/
260
263
publicfunctionunpack(?callable$func = null): self
261
264
{
@@ -277,8 +280,8 @@ static function (iterable $args = []) use ($func) {
277
280
* @param int<1, max> $length The size of each chunk.
278
281
* @param bool $preserve_keys When set to true keys will be preserved. Default is false which will reindex the chunk numerically.
@@ -319,12 +322,13 @@ private static function toChunks(Generator $input, int $length, bool $preserve_k
319
322
*
320
323
* With no callback is a no-op (can safely take a null).
321
324
*
325
+
* @template TMapKey
322
326
* @template TMapValue
323
327
*
324
-
* @param null|(callable(): (TMapValue|Generator<array-key, TMapValue, mixed, mixed>))|(callable(TOutput): (TMapValue|Generator<array-key, TMapValue, mixed, mixed>)) $func A callback must either return a value or yield values (return a generator).
328
+
* @param null|(callable(): (TMapValue|Generator<TMapKey, TMapValue, mixed, mixed>))|(callable(TValue): (TMapValue|Generator<TMapKey, TMapValue, mixed, mixed>)) $func A callback must either return a value or yield values (return a generator).
@@ -509,10 +513,10 @@ private static function resolveStringPredicate(callable $func): callable
509
513
/**
510
514
* Skips elements while the predicate returns true, and keeps everything after the predicate returns false just once.
511
515
*
512
-
* @param callable(TOutput): bool $predicate A callback returning boolean value.
516
+
* @param callable(TValue): bool $predicate A callback returning boolean value.
513
517
*
514
-
* @phpstan-self-out self<TOutput>
515
-
* @return Standard<TOutput>
518
+
* @phpstan-self-out self<TKey, TValue>
519
+
* @return Standard<TKey, TValue>
516
520
*/
517
521
publicfunctionskipWhile(callable$predicate): self
518
522
{
@@ -610,7 +614,7 @@ public function getIterator(): Traversable
610
614
611
615
/**
612
616
* By default, returns all values regardless of keys used, discarding all keys in the process. This is a terminal operation.
613
-
* @return list<TOutput>
617
+
* @return list<TValue>
614
618
*/
615
619
publicfunctiontoList(): array
616
620
{
@@ -653,7 +657,7 @@ public function toArrayPreservingKeys(): array
653
657
/**
654
658
* Returns all values preserving keys. This is a terminal operation.
655
659
*
656
-
* @return array<array-key, TOutput>
660
+
* @return array<TKey, TValue>
657
661
*/
658
662
publicfunctiontoAssoc(): array
659
663
{
@@ -678,8 +682,8 @@ public function toAssoc(): array
678
682
*
679
683
* @param-out int $count
680
684
*
681
-
* @phpstan-self-out self<TOutput>
682
-
* @return Standard<TOutput>
685
+
* @phpstan-self-out self<TKey, TValue>
686
+
* @return Standard<TKey, TValue>
683
687
*/
684
688
publicfunctionrunningCount(
685
689
?int &$count
@@ -720,8 +724,8 @@ public function count(): int
720
724
/**
721
725
* Converts the pipeline to a non-rewindable stream.
722
726
*
723
-
* @phpstan-self-out self<TOutput>
724
-
* @return Standard<TOutput>
727
+
* @phpstan-self-out self<TKey, TValue>
728
+
* @return Standard<TKey, TValue>
725
729
*/
726
730
publicfunctionstream()
727
731
{
@@ -752,8 +756,8 @@ private static function generatorFromIterable(iterable $input): Generator
752
756
* @param int $offset If offset is non-negative, the sequence will start at that offset. If offset is negative, the sequence will start that far from the end.
753
757
* @param ?int $length If length is given and is positive, then the sequence will have up to that many elements in it. If length is given and is negative then the sequence will stop that many elements from the end.
0 commit comments