Skip to content

Commit 7159809

Browse files
authored
Clearify serialization error message (#161)
1 parent 415da4c commit 7159809

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Enum.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,23 @@ final public function __clone()
8787
}
8888

8989
/**
90-
* @throws LogicException Enums are not serializable
91-
* because instances are implemented as singletons
90+
* @throws LogicException Serialization is not supported by default in this pseudo-enum implementation
9291
*
9392
* @psalm-return never-return
9493
*/
9594
final public function __sleep()
9695
{
97-
throw new LogicException('Enums are not serializable');
96+
throw new LogicException('Serialization is not supported by default in this pseudo-enum implementation');
9897
}
9998

10099
/**
101-
* @throws LogicException Enums are not serializable
102-
* because instances are implemented as singletons
100+
* @throws LogicException Serialization is not supported by default in this pseudo-enum implementation
103101
*
104102
* @psalm-return never-return
105103
*/
106104
final public function __wakeup()
107105
{
108-
throw new LogicException('Enums are not serializable');
106+
throw new LogicException('Serialization is not supported by default in this pseudo-enum implementation');
109107
}
110108

111109
/**

0 commit comments

Comments
 (0)