1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Improved; |
||
6 | |||
7 | /** |
||
8 | * Set all values of the iterable. |
||
9 | * |
||
10 | * @param iterable $iterable |
||
11 | * @param mixed $value |
||
12 | * @return \Generator |
||
13 | */ |
||
14 | 6 | function iterable_fill(iterable $iterable, $value): \Generator |
|
0 ignored issues
–
show
introduced
by
![]() |
|||
15 | { |
||
16 | 5 | foreach ($iterable as $key => $_) { |
|
17 | 4 | yield $key => $value; |
|
18 | } |
||
19 | } |
||
20 |