mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 13:35:29 +00:00
EnumTrait: override __clone, __sleep, __wakeup to prevent duplication
This commit is contained in:
parent
7ba573db77
commit
1170c8fe13
@ -97,4 +97,16 @@ trait EnumTrait{
|
||||
public function equals(self $other) : bool{
|
||||
return $this->enumName === $other->enumName;
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user