Passed
Push — master ( 04fdd7...92adf4 )
by Sérgio
03:41
created

props.php ➔ props()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
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
declare(strict_types=1);
4
5
namespace Prelude;
6
7
const props = __NAMESPACE__.'\props';
8
9
use Closure;
10
11
function props(array $ks): Closure
12
{
13
    return function (array $xs) use ($ks) {
14
        return array_map(function ($k) use ($xs) {
15 1
            return $xs[$k] ?? null;
16 1
        }, $ks);
17 1
    };
18
}
19