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

Chain::chain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 1
crap 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
}