Conditions | 9 |
Paths | 9 |
Total Lines | 37 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public static function get($key) |
||
20 | { |
||
21 | if(file_exists(serviceJson())){ |
||
22 | JsonHandler::$file = serviceJson(); |
||
23 | $serviceJson = JsonHandler::get(); |
||
24 | |||
25 | $dottedKey = explode('.',$key); |
||
26 | |||
27 | if(count($dottedKey)==2){ |
||
28 | |||
29 | if(isset($serviceJson['container'][$dottedKey[0]][$dottedKey[1]])){ |
||
30 | $arrayData = $serviceJson['container'][$dottedKey[0]][$dottedKey[1]]; |
||
31 | |||
32 | if($serviceJson['container-format'][$dottedKey[0]][$dottedKey[1]]=='string'){ |
||
33 | return $arrayData; |
||
34 | } |
||
35 | |||
36 | if($serviceJson['container-format'][$dottedKey[0]][$dottedKey[1]]=='closure'){ |
||
37 | return SuperClosure::get($arrayData); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 | else{ |
||
42 | |||
43 | if(isset($serviceJson['container'][$key])){ |
||
44 | if($serviceJson['container-format'][$key]=='string'){ |
||
45 | return $serviceJson['container'][$key]; |
||
46 | } |
||
47 | |||
48 | if($serviceJson['container-format'][$key]=='closure'){ |
||
49 | return SuperClosure::get($serviceJson['container'][$key]); |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 | |||
55 | return null; |
||
56 | } |
||
57 | } |