Passed
Push — master ( e1804d...801b1b )
by Sérgio
05:26 queued 02:17
created

reduce.php ➔ reduce()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Prelude;
6
7
const reduce = __NAMESPACE__.'\reduce';
8
9
function reduce(callable $callback)
0 ignored issues
show
Unused Code introduced by
The parameter $callback is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
10
{
11
    return function (array $xss, $initial = null) use ($callable) {
0 ignored issues
show
Bug introduced by
The variable $callable does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
12
        return array_reduce($xss, $callable, $initial);
13
    };
14
}
15