1 | <?php |
||
20 | class Serializer |
||
21 | { |
||
22 | /** |
||
23 | * Serialize things. |
||
24 | * |
||
25 | * @param mixed $object Item you want - string, array, integer, object |
||
26 | * |
||
27 | * @return string Containing a byte-stream representation. |
||
28 | */ |
||
29 | public static function serialize($object) |
||
49 | |||
50 | /** |
||
51 | * Unserialize things. |
||
52 | * |
||
53 | * @param string $object Serialized object. |
||
54 | * |
||
55 | * @return mixed |
||
56 | */ |
||
57 | public static function unserialize($object) |
||
71 | |||
72 | /** |
||
73 | * @param \stdClass $value Item value. |
||
74 | * |
||
75 | * @throws \RuntimeException If error during serialize. |
||
76 | * @return string |
||
77 | */ |
||
78 | public static function serializeNative($value) |
||
84 | |||
85 | /** |
||
86 | * @param string $serialized The serialized item-string. |
||
87 | * |
||
88 | * @throws \RuntimeException If error during unserialize. |
||
89 | * @return mixed |
||
90 | */ |
||
91 | public static function unserializeNative($serialized) |
||
97 | |||
98 | /** |
||
99 | * @param mixed $item Item |
||
100 | * |
||
101 | * @return \stdClass |
||
102 | */ |
||
103 | private static function mask($item) |
||
107 | |||
108 | /** |
||
109 | * @param mixed $item Item |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | private static function unmask($item) |
||
121 | } |
||
122 |