Passed
Push — master ( 03df52...d88a91 )
by Patrick
13:12
created

Arr   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 41
ccs 6
cts 6
cp 1
rs 10
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A pull() 0 3 2
A get() 0 3 2
A only() 0 3 2
1
<?php
2
3
namespace ShiftOneLabs\LaravelSqsFifoQueue\Support;
4
5
use Illuminate\Support\Arr as BaseArr;
6
7
class Arr
8
{
9
    /**
10
     * Get a subset of the items from the given array.
11
     *
12
     * @param  array  $array
13
     * @param  array|string  $keys
14
     *
15
     * @return array
16
     */
17 190
    public static function only($array, $keys)
18
    {
19 190
        return class_exists(BaseArr::class) ? BaseArr::only($array, $keys) : array_only($array, $keys);
0 ignored issues
show
Bug introduced by
The function array_only was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        return class_exists(BaseArr::class) ? BaseArr::only($array, $keys) : /** @scrutinizer ignore-call */ array_only($array, $keys);
Loading history...
20
    }
21
22
    /**
23
     * Get a value from the array, and remove it.
24
     *
25
     * @param  array   $array
26
     * @param  string  $key
27
     * @param  mixed   $default
28
     *
29
     * @return mixed
30
     */
31 228
    public static function pull(&$array, $key, $default = null)
32
    {
33 228
        return class_exists(BaseArr::class) ? BaseArr::pull($array, $key, $default) : array_pull($array, $key, $default);
0 ignored issues
show
Bug introduced by
The function array_pull was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        return class_exists(BaseArr::class) ? BaseArr::pull($array, $key, $default) : /** @scrutinizer ignore-call */ array_pull($array, $key, $default);
Loading history...
34
    }
35
36
    /**
37
     * Get an item from an array using "dot" notation.
38
     *
39
     * @param  \ArrayAccess|array  $array
40
     * @param  string|int  $key
41
     * @param  mixed   $default
42
     *
43
     * @return mixed
44
     */
45 646
    public static function get($array, $key, $default = null)
46
    {
47 646
        return class_exists(BaseArr::class) ? BaseArr::get($array, $key, $default) : array_get($array, $key, $default);
0 ignored issues
show
Bug introduced by
The function array_get was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

47
        return class_exists(BaseArr::class) ? BaseArr::get($array, $key, $default) : /** @scrutinizer ignore-call */ array_get($array, $key, $default);
Loading history...
48
    }
49
}
50