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

compose.php ➔ compose()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
1
<?php
2
3
namespace Sergiors\Functional;
4
5
/**
6
 * @author Sérgio Rafael Siqueira <[email protected]>
7
 *
8
 * Performs right-to-left function composition.
9
 * The rightmost function may have any arity; the remaining functions must be unary.
10
 *
11
 * @return mixed
12
 */
13
function compose()
14
{
15 1
    $args = func_get_args();
16
17 1
    return call_user_func_array(__NAMESPACE__.'\pipe', array_reverse($args));
18
}
19