Passed
Push — master ( c481cb...c71d3e )
by Sérgio
02:10
created

reduce.php ➔ reduce()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Prelude;
4
5
const reduce = __NAMESPACE__.'\reduce';
6
7
function reduce(...$args)
8
{
9
    $fn = partial(function (callable $fn, array $xss, $initial = null) {
10 1
        return array_reduce($xss, $fn, $initial);
11 1
    });
12
13 1
    return $fn(...$args);
14
}
15