Chain::chain()   A
last analyzed

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