Issues (172)

src/functions/iterable_apply.php (2 issues)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Improved;
6
7
/**
8
 * Apply a callback to each element.
9
 *
10
 * @param iterable $iterable
11
 * @param callable $callback
12
 * @return \Generator
13
 */
14 6
function iterable_apply(iterable $iterable, callable $callback): \Generator
0 ignored issues
show
Function Improved\iterable_apply() has parameter $iterable with no value type specified in iterable type iterable.
Loading history...
Function Improved\iterable_apply() return type has no value type specified in iterable type Generator.
Loading history...
15
{
16 5
    foreach ($iterable as $key => $value) {
17 4
        call_user_func($callback, $value, $key);
18
19 4
        yield $key => $value;
20
    }
21
}
22