Skip to content

Commit 38fc265

Browse files
committed
doc: serialization
1 parent 301a5bb commit 38fc265

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ of external values without wrapping them in an instance.
149149
This extension of `AbstractValue` provides easy serializability for the Value objects.
150150
It implements the [JsonSerializable](https://php.net/manual/class.jsonserializable.php) interface.
151151

152+
Standard PHP serialization via [serialize](https://secure.php.net/serialize)/[unserialize](https://secure.php.net/unserialize)
153+
is always supported.
154+
This class contains an extra `__wakeup()` implementation
155+
to make sure that unserialized instances always contain a valid value.
156+
152157
* <code>public function <b>\_\_toString</b>(): string</code>
153158

154159
Returns the wrapped value like `value()`, but with an explicit

src/AbstractSerializableValue.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
* This extension of AbstractValue provides easy serializability
77
* for the Value objects. It implements the JsonSerializable interface.
88
*
9+
* Standard PHP serialization via {@see serialize}/{@see unserialize} is always supported.
10+
* This class contains an extra {@see __wakeup} implementation
11+
* to make sure that unserialized instances always contain a valid value.
12+
*
913
* @author Maximilian Eul
1014
* @link https://github.com/mle86/php-value
1115
*/

0 commit comments

Comments
 (0)