Completed
Push — master ( 0ba342...c36cc2 )
by Adam
18s
created

Arr::has()   B

Complexity

Conditions 9
Paths 7

Size

Total Lines 33
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 33
rs 8.0555
c 0
b 0
f 0
cc 9
nc 7
nop 2
1
<?php
2
3
namespace Endeavors\Components\Routing;
4
5
use Illuminate\Support\Arr as BaseArr;
6
7
class Arr extends BaseArr
8
{
9
    /**
10
     * If the given value is not an array and not null, wrap it in one.
11
     *
12
     * @param  mixed  $value
13
     * @return array
14
     */
15
    public static function wrap($value)
16
    {
17
        if (is_null($value)) {
18
            return [];
19
        }
20
21
        return ! is_array($value) ? [$value] : $value;
22
    }
23
}