Conditions | 4 |
Paths | 4 |
Total Lines | 25 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public static function objectToArray($mObject) : array |
||
37 | { |
||
38 | if ( is_object($mObject)) { |
||
39 | |||
40 | $mObject = (array) $mObject; |
||
41 | } |
||
42 | |||
43 | |||
44 | if (is_array($mObject)) { |
||
45 | |||
46 | $aNew = array(); |
||
47 | |||
48 | foreach($mObject as $sKey => $mValues) { |
||
49 | |||
50 | $sKey = preg_replace("/^\\0(.*)\\0/", "", $sKey); |
||
51 | $aNew[$sKey] = self::objectToArray($mValues); |
||
52 | } |
||
53 | } |
||
54 | else { |
||
55 | |||
56 | $aNew = $mObject; |
||
57 | } |
||
58 | |||
59 | return $aNew; |
||
60 | } |
||
61 | } |
||
62 |