1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

fix tests

This commit is contained in:
kkmuffme 2022-10-17 16:25:43 +02:00
parent 25b01ce3a3
commit 2c47d06968

View File

@ -1560,13 +1560,13 @@ class FunctionTemplateTest extends TestCase
* @template TNewKey of array-key
* @template TNewValue
* @psalm-param iterable<TKey, TValue> $iterable
* @psalm-param callable(TKey, TValue): iterable<TNewKey, TNewValue> $mapper
* @psalm-param callable(TKey): iterable<TNewKey, TNewValue> $mapper
* @psalm-return \Generator<TNewKey, TNewValue>
*/
function map(iterable $iterable, callable $mapper): Generator
{
foreach ($iterable as $key => $value) {
yield from $mapper($key, $value);
foreach ($iterable as $key => $_) {
yield from $mapper($key);
}
}