Conditions | 3 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | public static function mongoIdToString(array $data) |
||
24 | { |
||
25 | // In some cases $value *might* still be mongoId type, |
||
26 | 43 | $callback = function(&$item, $key) |
|
27 | { |
||
28 | 43 | if ($key === 'primaryOne') |
|
29 | { |
||
30 | 5 | codecept_debug($item); |
|
31 | } |
||
32 | 43 | if ($item instanceof MongoId) |
|
33 | { |
||
34 | 1 | $item = (string) $item; |
|
35 | } |
||
36 | 43 | }; |
|
37 | |||
38 | 43 | array_walk_recursive($data, $callback); |
|
39 | 43 | return $data; |
|
40 | } |
||
41 | |||
43 |