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

Arr   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A wrap() 0 7 3
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
}