Skip to content

Commit

Permalink
sa: update SA info of various operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 2, 2022
1 parent 6c5e44c commit 25ed050
Show file tree
Hide file tree
Showing 29 changed files with 214 additions and 123 deletions.
94 changes: 67 additions & 27 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ parameters:
count: 1
path: src/Collection.php

-
message: "#^Method loophp\\\\collection\\\\Collection\\:\\:partition\\(\\) should return loophp\\\\collection\\\\Contract\\\\Collection\\<int, loophp\\\\collection\\\\Contract\\\\Collection\\<TKey, T\\>\\> but returns loophp\\\\collection\\\\Contract\\\\Collection\\<mixed, loophp\\\\collection\\\\Collection\\<mixed, mixed\\>\\>\\.$#"
count: 1
path: src/Collection.php

-
message: "#^Method loophp\\\\collection\\\\Collection\\:\\:span\\(\\) should return loophp\\\\collection\\\\Contract\\\\Collection\\<int, loophp\\\\collection\\\\Contract\\\\Collection\\<TKey, T\\>\\> but returns loophp\\\\collection\\\\Contract\\\\Collection\\<mixed, loophp\\\\collection\\\\Collection\\<mixed, mixed\\>\\>\\.$#"
count: 1
path: src/Collection.php

-
message: "#^Method loophp\\\\collection\\\\Collection\\:\\:tails\\(\\) should return loophp\\\\collection\\\\Contract\\\\Collection\\<int, array\\<int, T\\>\\> but returns loophp\\\\collection\\\\Collection\\<int, array\\<int, mixed\\>\\>\\.$#"
count: 1
Expand All @@ -36,22 +46,17 @@ parameters:
path: src/Collection.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed, mixed, mixed, iterable\\)\\: mixed, callable\\(T, T, TKey, Iterator\\<TKey, T\\>\\)\\: T given\\.$#"
count: 2
path: src/Collection.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed, mixed, mixed, iterable\\)\\: mixed, callable\\(mixed, T, TKey, Iterator\\<TKey, T\\>\\)\\: mixed given\\.$#"
count: 2
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed, mixed, mixed, iterable\\)\\: mixed, callable\\(T\\|V, T, TKey, Iterator\\<TKey, T\\>\\)\\: V given\\.$#"
count: 4
path: src/Collection.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, \\(callable\\(TKey\\=, T\\=, Iterator\\<TKey, T\\>\\=\\)\\: NewTKey\\)\\|\\(Closure\\(mixed\\)\\: mixed\\) given\\.$#"
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, \\(callable\\(TKey\\=, T\\=, Iterator\\<TKey, T\\>\\=\\)\\: UKey\\)\\|\\(Closure\\(mixed\\)\\: mixed\\) given\\.$#"
count: 1
path: src/Collection.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, callable\\(T\\=, TKey\\=, Iterator\\<TKey, T\\>\\=\\)\\: mixed given\\.$#"
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, callable\\(T\\=, TKey\\=, Iterator\\<TKey, T\\>\\=\\)\\: U given\\.$#"
count: 1
path: src/Collection.php

Expand Down Expand Up @@ -131,7 +136,7 @@ parameters:
path: src/Collection.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<mixed,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, mixed\\=, Iterator\\<mixed, mixed\\>\\=\\)\\: mixed, Closure\\(iterable\\)\\: loophp\\\\collection\\\\Collection\\<mixed, mixed\\> given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<mixed,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, mixed\\=, Iterator\\<mixed, mixed\\>\\=\\)\\: loophp\\\\collection\\\\Collection\\<mixed, mixed\\>, Closure\\(iterable\\)\\: loophp\\\\collection\\\\Collection\\<mixed, mixed\\> given\\.$#"
count: 2
path: src/Collection.php

Expand Down Expand Up @@ -235,6 +240,36 @@ parameters:
count: 1
path: src/Operation/Flip.php

-
message: "#^Template type V of method loophp\\\\collection\\\\Operation\\\\FoldLeft\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
path: src/Operation/FoldLeft.php

-
message: "#^Template type W of method loophp\\\\collection\\\\Operation\\\\FoldLeft\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
path: src/Operation/FoldLeft.php

-
message: "#^Template type V of method loophp\\\\collection\\\\Operation\\\\FoldLeft1\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
path: src/Operation/FoldLeft1.php

-
message: "#^Template type V of method loophp\\\\collection\\\\Operation\\\\FoldRight\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
path: src/Operation/FoldRight.php

-
message: "#^Template type W of method loophp\\\\collection\\\\Operation\\\\FoldRight\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
path: src/Operation/FoldRight.php

-
message: "#^Template type V of method loophp\\\\collection\\\\Operation\\\\FoldRight1\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
path: src/Operation/FoldRight1.php

-
message: "#^Parameter \\#1 \\.\\.\\.\\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: bool, Closure\\(mixed, mixed\\)\\: bool given\\.$#"
count: 1
Expand Down Expand Up @@ -340,6 +375,11 @@ parameters:
count: 1
path: src/Operation/Product.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, Closure\\(iterable, iterable\\)\\: Generator given\\.$#"
count: 1
path: src/Operation/Product.php

-
message: "#^Template type U of method loophp\\\\collection\\\\Operation\\\\Product\\:\\:__invoke\\(\\) is not referenced in a parameter\\.$#"
count: 1
Expand Down Expand Up @@ -521,7 +561,7 @@ parameters:
path: tests/static-analysis/associate.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, int\\=, Iterator\\<int, mixed\\>\\=\\)\\: mixed, Closure\\(string\\)\\: int given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, int\\=, Iterator\\<int, mixed\\>\\=\\)\\: int, Closure\\(string\\)\\: int given\\.$#"
count: 1
path: tests/static-analysis/column.php

Expand Down Expand Up @@ -701,42 +741,42 @@ parameters:
path: tests/static-analysis/has.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int\\=, int\\=, Iterator\\<int, int\\>\\=\\)\\: mixed, Closure\\(int\\)\\: int given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int\\=, int\\=, Iterator\\<int, int\\>\\=\\)\\: int, Closure\\(int\\)\\: int given\\.$#"
count: 3
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int\\=, int\\=, Iterator\\<int, int\\>\\=\\)\\: mixed, Closure\\(int\\)\\: numeric\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int\\=, int\\=, Iterator\\<int, int\\>\\=\\)\\: string, Closure\\(int\\)\\: numeric\\-string given\\.$#"
count: 1
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, int\\=, Iterator\\<int, string\\>\\=\\)\\: mixed, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, int\\=, Iterator\\<int, string\\>\\=\\)\\: string, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<string,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, string\\=, Iterator\\<string, string\\>\\=\\)\\: mixed, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<string,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, string\\=, Iterator\\<string, string\\>\\=\\)\\: stdClass, Closure\\(string\\)\\: stdClass given\\.$#"
count: 1
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<string,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, string\\=, Iterator\\<string, string\\>\\=\\)\\: mixed, Closure\\(string\\)\\: stdClass given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<string,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, string\\=, Iterator\\<string, string\\>\\=\\)\\: string, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, int\\=, Iterator\\<int, mixed\\>\\=\\)\\: mixed, Closure\\(int\\)\\: int given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int\\=, int\\=, Iterator\\<int, int\\>\\=\\)\\: int, Closure\\(int\\)\\: int given\\.$#"
count: 1
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, int\\=, Iterator\\<int, mixed\\>\\=\\)\\: mixed, Closure\\(int\\)\\: numeric\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int\\=, int\\=, Iterator\\<int, int\\>\\=\\)\\: string, Closure\\(int\\)\\: numeric\\-string given\\.$#"
count: 1
path: tests/static-analysis/map.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,mixed\\>\\:\\:map\\(\\) expects callable\\(mixed\\=, int\\=, Iterator\\<int, mixed\\>\\=\\)\\: mixed, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Contract\\\\Operation\\\\Mapable\\<int,string\\>\\:\\:map\\(\\) expects callable\\(string\\=, int\\=, Iterator\\<int, string\\>\\=\\)\\: string, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/map.php

Expand Down Expand Up @@ -861,42 +901,42 @@ parameters:
path: tests/static-analysis/reject.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanLeft\\(\\) expects callable\\(mixed\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: mixed, Closure\\(int, int\\)\\: int given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanLeft\\(\\) expects callable\\(bool\\|string\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: string, Closure\\(mixed, int\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/scanLeft.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanLeft\\(\\) expects callable\\(mixed\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: mixed, Closure\\(mixed, int\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanLeft\\(\\) expects callable\\(int\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: int, Closure\\(int, int\\)\\: int given\\.$#"
count: 1
path: tests/static-analysis/scanLeft.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanLeft\\(\\) expects callable\\(mixed\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: mixed, Closure\\(string, string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanLeft\\(\\) expects callable\\(string\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: string, Closure\\(string, string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/scanLeft.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanLeft\\(\\) expects callable\\(mixed\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: mixed, Closure\\(string\\|null, string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanLeft\\(\\) expects callable\\(string\\|null\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: string, Closure\\(string\\|null, string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/scanLeft.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanRight\\(\\) expects callable\\(mixed\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: mixed, Closure\\(int, int\\)\\: int given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanRight\\(\\) expects callable\\(bool\\|string\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: string, Closure\\(mixed, int\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/scanRight.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanRight\\(\\) expects callable\\(mixed\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: mixed, Closure\\(mixed, int\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,int\\>\\:\\:scanRight\\(\\) expects callable\\(int\\=, int\\=, int\\=, iterable\\<int, int\\>\\=\\)\\: int, Closure\\(int, int\\)\\: int given\\.$#"
count: 1
path: tests/static-analysis/scanRight.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanRight\\(\\) expects callable\\(mixed\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: mixed, Closure\\(string, string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanRight\\(\\) expects callable\\(string\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: string, Closure\\(string, string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/scanRight.php

-
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanRight\\(\\) expects callable\\(mixed\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: mixed, Closure\\(string\\|null, string\\)\\: non\\-falsy\\-string given\\.$#"
message: "#^Parameter \\#1 \\$callback of method loophp\\\\collection\\\\Collection\\<int,string\\>\\:\\:scanRight\\(\\) expects callable\\(string\\|null\\=, string\\=, int\\=, iterable\\<int, string\\>\\=\\)\\: string, Closure\\(string\\|null, string\\)\\: non\\-falsy\\-string given\\.$#"
count: 1
path: tests/static-analysis/scanRight.php

Expand Down
26 changes: 15 additions & 11 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.24.0@06dd975cb55d36af80f242561738f16c5f58264f">
<files psalm-version="4.29.0@7ec5ffbd5f68ae03782d7fd33fff0c45a69f95b3">
<file src="src/Collection.php">
<InvalidArgument occurrences="5">
<code>$callback</code>
Expand All @@ -14,9 +14,6 @@
<InvalidReturnType occurrences="1">
<code>CollectionInterface</code>
</InvalidReturnType>
<InvalidScalarArgument occurrences="1">
<code>$callable</code>
</InvalidScalarArgument>
<LessSpecificReturnStatement occurrences="1">
<code>new self((new Zip())()(...$iterables), [$this])</code>
</LessSpecificReturnStatement>
Expand All @@ -27,9 +24,6 @@
<code>$callbackForKeys ?? $defaultCallback</code>
<code>$callbackForValues ?? $defaultCallback</code>
</PossiblyInvalidArgument>
<PossiblyNullArgument occurrences="1">
<code>$callback</code>
</PossiblyNullArgument>
</file>
<file src="src/Operation/All.php">
<InvalidReturnStatement occurrences="1"/>
Expand All @@ -38,14 +32,24 @@
</InvalidReturnType>
</file>
<file src="src/Operation/Averages.php">
<InvalidReturnStatement occurrences="1"/>
<InvalidReturnType occurrences="1">
<code>Closure(iterable&lt;TKey, T&gt;): Generator&lt;int, float&gt;</code>
</InvalidReturnType>
<InvalidScalarArgument occurrences="1">
<code>static fn (float $acc, float $value, int $key): float =&gt; ($acc * $key + $value) / ($key + 1)</code>
</InvalidScalarArgument>
</file>
<file src="src/Operation/Inits.php">
<InvalidArgument occurrences="2">
<code>[]</code>
</InvalidArgument>
</file>
<file src="src/Operation/Pack.php">
<InvalidReturnType occurrences="1">
<code>Generator&lt;int, array{0: TKey, 1: T}&gt;</code>
</InvalidReturnType>
</file>
<file src="src/Operation/Product.php">
<InvalidArgument occurrences="2">
<code>[[]]</code>
<code>static fn (iterable $a, iterable $x): Generator =&gt; $f($x)($a)</code>
</InvalidArgument>
</file>
</files>
4 changes: 2 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function flip(): CollectionInterface
return new self((new Flip())(), [$this]);
}

public function foldLeft(callable $callback, $initial = null)
public function foldLeft(callable $callback, $initial)
{
return (new self((new FoldLeft())()($callback)($initial), [$this]))->current();
}
Expand All @@ -423,7 +423,7 @@ public function foldLeft1(callable $callback)
return (new self((new FoldLeft1())()($callback), [$this]))->current();
}

public function foldRight(callable $callback, $initial = null)
public function foldRight(callable $callback, $initial)
{
return (new self((new Foldright())()($callback)($initial), [$this]))->current();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Contract/Operation/Appendable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Appendable
*
* @see https://loophp-collection.readthedocs.io/en/stable/pages/api.html#append
*
* @template U of T
* @template U
*
* @param U ...$items
*
Expand Down
10 changes: 5 additions & 5 deletions src/Contract/Operation/Associateable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ interface Associateable
*
* @see https://loophp-collection.readthedocs.io/en/stable/pages/api.html#associate
*
* @template NewT
* @template NewTKey
* @template UKey
* @template U
*
* @param callable(TKey=, T=, Iterator<TKey, T>=): NewTKey $callbackForKeys
* @param callable(T=, TKey=, Iterator<TKey, T>=): NewT $callbackForValues
* @param callable(TKey=, T=, Iterator<TKey, T>=): UKey $callbackForKeys
* @param callable(T=, TKey=, Iterator<TKey, T>=): U $callbackForValues
*
* @return Collection<NewTKey, NewT>
* @return Collection<UKey, U>
*/
public function associate(?callable $callbackForKeys = null, ?callable $callbackForValues = null): Collection;
}
8 changes: 4 additions & 4 deletions src/Contract/Operation/FlatMapable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ interface FlatMapable
*
* @see https://loophp-collection.readthedocs.io/en/stable/pages/api.html#flatmap
*
* @template IKey
* @template IValue
* @template UKey
* @template U
*
* @param callable(T=, TKey=, iterable<TKey, T>=): iterable<IKey, IValue> $callback
* @param callable(T=, TKey=, iterable<TKey, T>=): iterable<UKey, U> $callback
*
* @return Collection<IKey, IValue>
* @return Collection<UKey, U>
*/
public function flatMap(callable $callback): Collection;
}
Loading

0 comments on commit 25ed050

Please sign in to comment.