diff --git a/src/Currency.php b/src/Currency.php index f0505481..733e6902 100644 --- a/src/Currency.php +++ b/src/Currency.php @@ -57,4 +57,17 @@ public function jsonSerialize(): string { return $this->code; } + + /** + * @return array + */ + public function __serialize(): array + { + return ['code' => $this->code]; + } + + public function __unserialize(array $data): void + { + $this->code = (string) $data['code']; + } }