Passed
Push — master ( 1c0807...13097d )
by Radu
02:22
created

Arrays::isMultidimensional()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 2
nc 2
nop 1
1
<?php
2
namespace WebServCo\Framework\Utils;
3
4
final class Arrays
5
{
6
    public static function get($array, $key, $defaultValue = false)
7
    {
8
        return array_key_exists($key, $array) ? $array[$key] : $defaultValue;
9
    }
10
11
    public static function isMultidimensional($array = [])
12
    {
13
        if (empty($array)) {
14
            return false;
15
        }
16
        return is_array($array[key($array)]);
17
    }
18
}
19