Conditions | 2 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 0 |
1 | <?php |
||
33 | 49 | public static function mongoIdToString(array $data) |
|
34 | { |
||
35 | // In some cases $value *might* still be mongoId type, |
||
36 | $callback = function(&$item, $key) |
||
37 | { |
||
38 | 49 | if ($item instanceof MongoId) |
|
39 | { |
||
40 | $item = (string) $item; |
||
41 | } |
||
42 | 49 | }; |
|
43 | |||
44 | 49 | array_walk_recursive($data, $callback); |
|
45 | 49 | return $data; |
|
46 | } |
||
47 | |||
49 |