diff --git a/src/BitPayKeyUtils/KeyHelper/Key.php b/src/BitPayKeyUtils/KeyHelper/Key.php index b0ec71e..73ce20b 100644 --- a/src/BitPayKeyUtils/KeyHelper/Key.php +++ b/src/BitPayKeyUtils/KeyHelper/Key.php @@ -101,6 +101,34 @@ public function unserialize($data) ) = unserialize($data); } + /** + * @return array + */ + public function __serialize(): array + { + return [ + $this->id, + $this->x, + $this->y, + $this->hex, + $this->dec, + ]; + } + + /** + * @param array $data + */ + public function __unserialize(array $data): void + { + list( + $this->id, + $this->x, + $this->y, + $this->hex, + $this->dec + ) = $data; + } + /** * @return boolean */