Passed
Push — master ( a4f811...9ce3fe )
by Arnold
02:14
created

iterable_walk()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 3
nc 3
nop 1
dl 0
loc 7
ccs 3
cts 3
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jasny;
6
7
/**
8
 * Traverse over the iterator, not capturing the values.
9
 * This is particularly useful after `iterable_apply()`.
10
 *
11
 * @param iterable $iterable
12
 * @return void
13
 */
14
function iterable_walk(iterable $iterable): void
15
{
16 8
    if (is_array($iterable)) {
17 1
        return; // No point walking over an array
18
    }
19
20 7
    foreach ($iterable as $value) {
21
    }
22
}
23