| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 6 | public static function getVal($arr = array(), $key = "") |
||
| 7 | { |
||
| 8 | $val = $arr; |
||
| 9 | $i = 0; |
||
| 10 | $keys = explode(".", $key); |
||
| 11 | |||
| 12 | while ($i < count($keys)) { |
||
| 13 | if (!HelperArray::hasKey($val, $keys[$i])) { |
||
| 14 | throw new \OutOfBoundsException("key ". $keys[$i] .", not found in the target array."); |
||
| 15 | } |
||
| 16 | |||
| 17 | $val = $val[$keys[$i]]; |
||
| 18 | |||
| 19 | $i++; |
||
| 20 | } |
||
| 21 | |||
| 22 | return $val; |
||
| 23 | } |
||
| 24 | |||
| 43 |