Arr   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
ccs 11
cts 11
cp 1
wmc 4
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A dot() 0 18 4
1
<?php namespace Arcanesoft\Settings\Helpers;
2
3
use Illuminate\Support\Arr as IlluminateArr;
4
5
/**
6
 * Class     Arr
7
 *
8
 * @package  Arcanesoft\Settings\Helpers
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class Arr extends IlluminateArr
12
{
13
    /**
14
     * Flatten a multi-dimensional associative array with dots.
15
     *
16
     * @param  array   $array
17
     * @param  string  $prepend
18
     *
19
     * @return array
20
     */
21 18
    public static function dot($array, $prepend = '')
22
    {
23 18
        $results = [];
24
25 18
        foreach ($array as $key => $value) {
26 18
            if (is_array($value)) {
27 6
                if (self::isAssoc($value)) {
28 3
                    $results = array_merge($results, self::dot($value, $prepend.$key.'.'));
29
30 3
                    continue;
31
                }
32 2
            }
33
34 18
            $results[$prepend.$key] = $value;
35 12
        }
36
37 18
        return $results;
38
    }
39
}
40