Conditions | 6 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | private static function prepareItemData($item) |
||
45 | { |
||
46 | if (method_exists($item, 'getArrayCopy')) { |
||
47 | return self::prepareUnserializableData($item->getArrayCopy()); |
||
48 | } |
||
49 | |||
50 | if (method_exists($item, 'toDateTime')) { |
||
51 | return $item->toDateTime()->format('r'); |
||
52 | } |
||
53 | |||
54 | if (method_exists($item, '__toString')) { |
||
55 | return $item->__toString(); |
||
56 | } |
||
57 | |||
58 | if (is_array($item) || is_object($item)) { |
||
59 | return self::prepareUnserializableData((array)$item); |
||
60 | } |
||
61 | |||
62 | return $item; |
||
63 | } |
||
64 | |||
66 |