Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 5 | public static function fill($array, $path, $value) |
|
25 | { |
||
26 | 5 | $parts = explode('.', $path); |
|
27 | 5 | $key = array_shift($parts); |
|
28 | 5 | if (empty($path)) |
|
29 | { |
||
30 | 5 | return $value; |
|
31 | } |
||
32 | 5 | if (!array_key_exists($key, $array)) |
|
33 | { |
||
34 | 5 | $array[$key] = self::fill($array, implode('.', $parts), $value); |
|
35 | } |
||
36 | 5 | return $array; |
|
37 | } |
||
38 | } |