Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function get($index, $default = null) |
||
33 | { |
||
34 | $indexes = explode('.', trim($index, '.')); |
||
35 | $payload = $this->raw; |
||
36 | $value = $default; |
||
37 | |||
38 | foreach ($indexes as $indexValue) { |
||
39 | if (!isset($payload[$indexValue])) { |
||
40 | return $default; |
||
41 | } |
||
42 | $value = $payload = $payload[$indexValue]; |
||
43 | } |
||
44 | |||
45 | return $value; |
||
46 | } |
||
47 | |||
56 |