Conditions | 7 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | protected static function accessArrayOrObject($key, $data) |
||
37 | { |
||
38 | $output = ''; |
||
39 | if (is_array($key) || is_object($key)) { |
||
40 | $output = $key; |
||
41 | } elseif (is_array($data) && array_key_exists($key, $data)) { |
||
42 | $output = $data[$key]; |
||
43 | } elseif (is_object($data) && property_exists($data, $key)) { |
||
44 | $output = $data->$key; |
||
45 | } |
||
46 | return $output; |
||
47 | } |
||
48 | } |
||
49 |