diff --git a/src/Enum.php b/src/Enum.php index d602d8b..e9ef6ff 100644 --- a/src/Enum.php +++ b/src/Enum.php @@ -96,6 +96,16 @@ final public function __sleep() throw new LogicException('Serialization is not supported by default in this pseudo-enum implementation'); } + /** + * @throws LogicException Serialization is not supported by default in this pseudo-enum implementation + * + * @return array + */ + public function __serialize(): array + { + throw new LogicException('Serialization is not supported by default in this pseudo-enum implementation'); + } + /** * @throws LogicException Serialization is not supported by default in this pseudo-enum implementation * @@ -106,6 +116,16 @@ final public function __wakeup() throw new LogicException('Serialization is not supported by default in this pseudo-enum implementation'); } + /** + * @throws LogicException Serialization is not supported by default in this pseudo-enum implementation + * + * @param array $data + */ + public function __unserialize(array $data): void + { + throw new LogicException('Serialization is not supported by default in this pseudo-enum implementation'); + } + /** * Get the value of the enumerator *