Completed
Push — master ( b03e32...44190a )
by Sérgio
03:19
created

prop.php ➔ prop()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 2
Metric Value
cc 2
eloc 7
nc 1
nop 0
dl 14
loc 14
ccs 6
cts 6
cp 1
crap 2
rs 9.4285
1
<?php
2
3
namespace Sergiors\Functional;
4
5
/**
6
 * @author Sérgio Rafael Siqueira <[email protected]>
7
 *
8
 * @return mixed
9
 */
10 View Code Duplication
function prop()
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12 2
    $args = func_get_args();
13
14
    $prop = function ($prop, $ls) {
15 2
        if (has($prop, $ls)) {
16 2
            return $ls[$prop];
17
        }
18
19 1
        return false;
20 2
    };
21
22 2
    return call_user_func_array(curry($prop), $args);
23
}
24