Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | 6 | public function serialize($object) |
|
19 | { |
||
20 | 6 | if (! $object instanceof Serializable) { |
|
21 | 3 | throw new SerializationException(sprintf( |
|
22 | 3 | 'Object \'%s\' does not implement Serializable', |
|
23 | get_class($object) |
||
24 | )); |
||
25 | } |
||
26 | return array( |
||
27 | 3 | 'class' => get_class($object), |
|
28 | 3 | 'payload' => $object->serialize() |
|
29 | ); |
||
30 | } |
||
31 | /** |
||
46 | } |