| Conditions | 3 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | function getin() |
||
| 17 | { |
||
| 18 | 1 | $args = func_get_args(); |
|
| 19 | |||
| 20 | $getin = function (array $xs, array $ks, $notfound = false) { |
||
| 21 | 1 | if (false === isset($ks[0])) { |
|
| 22 | return $xs; |
||
| 23 | } |
||
| 24 | |||
| 25 | 1 | $x = get($xs, $ks[0], $notfound); |
|
| 26 | |||
| 27 | 1 | if (is_array($x)) { |
|
| 28 | 1 | return getin($x, array_slice($ks, 1), $notfound); |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | return $x; |
|
| 32 | 1 | }; |
|
| 33 | |||
| 34 | 1 | return call_user_func_array(partial($getin), $args); |
|
| 35 | } |
||
| 36 |