Completed
Push — master ( faf679...9221e6 )
by Mohamed
11s
created

Chain   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
dl 0
loc 19
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A chain() 0 3 1
1
<?php
2
3
namespace __\Sequence;
4
5
use __;
6
7
trait Chain
8
{
9
    /**
10
     * returns a wrapper instance, allows the value to be passed through multiple bottomline functions
11
     *
12
     * __::chain([0, 1, 2, 3, null])
13
     *   ->compact()
14
     *   ->prepend(4)
15
     *   ->value();
16
     * >> [4, 1, 2, 3]
17
     *
18
     * @param mixed $initialValue
19
     *
20
     * @return mixed
21
     *
22
     */
23 1
    public static function chain($initialValue)
24
    {
25 1
        return new PhpLodashWrapper($initialValue);
26
    }
27
}