Standardize serialize denying

This commit is contained in:
Dylan K. Taylor
2021-09-03 21:07:10 +01:00
parent aa5a9f6d12
commit b026ada489
3 changed files with 39 additions and 17 deletions

View File

@ -27,6 +27,7 @@ use function preg_match;
trait EnumTrait{
use RegistryTrait;
use NotSerializable;
/**
* Registers the given object as an enum member.
@ -101,12 +102,4 @@ trait EnumTrait{
public function __clone(){
throw new \LogicException("Enum members cannot be cloned");
}
public function __sleep(){
throw new \LogicException("Enum members cannot be serialized");
}
public function __wakeup(){
throw new \LogicException("Enum members cannot be unserialized");
}
}