Conditions | 6 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function get(string $name, $default = null) |
||
33 | { |
||
34 | $path = explode('.', $name); |
||
35 | $current = $this->data; |
||
36 | foreach ($path as $field) { |
||
37 | if (isset($current) && isset($current[$field])) { |
||
38 | $current = $current[$field]; |
||
39 | } elseif (is_array($current) && isset($current[$field])) { |
||
40 | $current = $current[$field]; |
||
41 | } else { |
||
42 | return $default; |
||
43 | } |
||
44 | } |
||
45 | return $current; |
||
46 | } |
||
48 |