Passed
Push — master ( e00bfb...6b59e9 )
by Patrick
24:00
created

Arr::except()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 1
c 0
b 0
f 0
nc 2
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 2
rs 10
1
<?php
2
3
namespace ShiftOneLabs\LaravelSqsFifoQueue\Support;
4
5
use Illuminate\Support\Arr as BaseArr;
6
7
class Arr
8
{
9
    /**
10
     * Get all of the given array except for a specified array of keys.
11
     *
12
     * @param  array  $array
13
     * @param  array|string  $keys
14
     *
15
     * @return array
16
     */
17 1190
    public static function except($array, $keys)
18
    {
19 1190
        return class_exists(BaseArr::class) ? BaseArr::except($array, $keys) : array_except($array, $keys);
0 ignored issues
show
Bug introduced by
The function array_except 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::except($array, $keys) : /** @scrutinizer ignore-call */ array_except($array, $keys);
Loading history...
20
    }
21
22
    /**
23
     * Get a subset of the items from the given array.
24
     *
25
     * @param  array  $array
26
     * @param  array|string  $keys
27
     *
28
     * @return array
29
     */
30 1610
    public static function only($array, $keys)
31
    {
32 1610
        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

32
        return class_exists(BaseArr::class) ? BaseArr::only($array, $keys) : /** @scrutinizer ignore-call */ array_only($array, $keys);
Loading history...
33
    }
34
35
    /**
36
     * Get a value from the array, and remove it.
37
     *
38
     * @param  array   $array
39
     * @param  string  $key
40
     * @param  mixed   $default
41
     *
42
     * @return mixed
43
     */
44 1680
    public static function pull(&$array, $key, $default = null)
45
    {
46 1680
        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

46
        return class_exists(BaseArr::class) ? BaseArr::pull($array, $key, $default) : /** @scrutinizer ignore-call */ array_pull($array, $key, $default);
Loading history...
47
    }
48
49
    /**
50
     * Get an item from an array using "dot" notation.
51
     *
52
     * @param  \ArrayAccess|array  $array
53
     * @param  string|int  $key
54
     * @param  mixed   $default
55
     *
56
     * @return mixed
57
     */
58 2660
    public static function get($array, $key, $default = null)
59
    {
60 2660
        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

60
        return class_exists(BaseArr::class) ? BaseArr::get($array, $key, $default) : /** @scrutinizer ignore-call */ array_get($array, $key, $default);
Loading history...
61
    }
62
}
63