Passed
Push — master ( 4cb285...5a0531 )
by Mohamed
01:37
created

Chain   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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