Completed
Push — master ( afeb56...2cd07b )
by Arnold
02:19
created

iterable_fill()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 2
rs 10
c 0
b 0
f 0
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
function iterable_fill(iterable $iterable, $value): \Generator
15
{
16 5
    foreach ($iterable as $key => $_) {
17 4
        yield $key => $value;
18
    }
19
}
20