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